@@ -355,6 +355,8 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
init_waitqueue_head(&cli->cl_destroy_waitq);
atomic_set(&cli->cl_destroy_in_flight, 0);
+
+ cli->cl_supp_cksum_types = OBD_CKSUM_CRC32;
/* Turn on checksumming by default. */
cli->cl_checksum = 1;
/*
@@ -362,8 +364,7 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
* Set cl_chksum* to CRC32 for now to avoid returning screwed info
* through procfs.
*/
- cli->cl_cksum_type = OBD_CKSUM_CRC32;
- cli->cl_supp_cksum_types = OBD_CKSUM_CRC32;
+ cli->cl_cksum_type = cli->cl_supp_cksum_types;
atomic_set(&cli->cl_resends, OSC_DEFAULT_RESENDS);
/*
@@ -479,7 +479,8 @@ struct ll_sb_info {
unsigned int ll_umounting:1,
ll_xattr_cache_enabled:1,
ll_xattr_cache_set:1, /* already set to 0/1 */
- ll_client_common_fill_super_succeeded:1;
+ ll_client_common_fill_super_succeeded:1,
+ ll_checksum_set:1;
struct lustre_client_ocd ll_lco;
@@ -560,13 +560,15 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt)
}
checksum = sbi->ll_flags & LL_SBI_CHECKSUM;
- err = obd_set_info_async(NULL, sbi->ll_dt_exp, sizeof(KEY_CHECKSUM),
- KEY_CHECKSUM, sizeof(checksum), &checksum,
- NULL);
- if (err) {
- CERROR("%s: Set checksum failed: rc = %d\n",
- sbi->ll_dt_exp->exp_obd->obd_name, err);
- goto out_root;
+ if (sbi->ll_checksum_set) {
+ err = obd_set_info_async(NULL, sbi->ll_dt_exp,
+ sizeof(KEY_CHECKSUM), KEY_CHECKSUM,
+ sizeof(checksum), &checksum, NULL);
+ if (err) {
+ CERROR("%s: Set checksum failed: rc = %d\n",
+ sbi->ll_dt_exp->exp_obd->obd_name, err);
+ goto out_root;
+ }
}
cl_sb_init(sb);
@@ -763,10 +765,11 @@ static inline int ll_set_opt(const char *opt, char *data, int fl)
}
/* non-client-specific mount options are parsed in lmd_parse */
-static int ll_options(char *options, int *flags)
+static int ll_options(char *options, struct ll_sb_info *sbi)
{
int tmp;
char *s1 = options, *s2;
+ int *flags = &sbi->ll_flags;
if (!options)
return 0;
@@ -832,11 +835,13 @@ static int ll_options(char *options, int *flags)
tmp = ll_set_opt("checksum", s1, LL_SBI_CHECKSUM);
if (tmp) {
*flags |= tmp;
+ sbi->ll_checksum_set = 1;
goto next;
}
tmp = ll_set_opt("nochecksum", s1, LL_SBI_CHECKSUM);
if (tmp) {
*flags &= ~tmp;
+ sbi->ll_checksum_set = 1;
goto next;
}
tmp = ll_set_opt("lruresize", s1, LL_SBI_LRU_RESIZE);
@@ -971,7 +976,7 @@ int ll_fill_super(struct super_block *sb)
goto out_free;
}
- err = ll_options(lsi->lsi_lmd->lmd_opts, &sbi->ll_flags);
+ err = ll_options(lsi->lsi_lmd->lmd_opts, sbi);
if (err)
goto out_free;