Whamcloud - gitweb
LU-10906 checksum: enable/disable checksum correctly 95/32095/7
authorEmoly Liu <emoly.liu@intel.com>
Fri, 20 Apr 2018 11:10:00 +0000 (19:10 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 21 May 2018 16:52:33 +0000 (16:52 +0000)
commite9b13cd1daf959b40e9ff5c810368c67e9491e06
treef1579866a411efd8722fefd533425083308e43c5
parent804739be1f3bdd28e47d2e71b8ca78923549db25
LU-10906 checksum: enable/disable checksum correctly

There are three ways to set checksum support in Lustre. Their
order during client mount is:
- 1. configure --enable/disable-checksum, this(ENABLE_CHECKSUM)
  only affects the default mount option and is set in function
  client_obd_setup().
- 2. lctl set_param -P osc.*.checksums=0/1, when processing llog,
  this value will be set by osc_checksum_seq_write().
- 3. mount option checksum/nochecksum, this will be checked in
  ll_options() and be set in client_common_fill_super()->
  obd_set_info_async().

This patch fixes one issue in 3. That is if mount option
"-o checksum/nochecksum" is specified, checksum will be changed
accordingly, no matter what is set by "set_param -P" or the
default option; and if no mount option is specified, the value
set by "set_param -P" will be kept. Also, test_77k is added to
sanity.sh to verify this patch.

What's more, a minor initialization issue of cl_supp_cksum_types
is fixed. cl_supp_cksum_types should be always initialized no
matter checksum is enabled or not.

Change-Id: I95d73122d800f5cd44b5fabb0cf00b5be0a35443
Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-on: https://review.whamcloud.com/32095
Reviewed-by: Yingjin Qian <qian@ddn.com>
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/ldlm/ldlm_lib.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/tests/sanity.sh