From 5c3151841520001b75e908af0fc3446d80853969 Mon Sep 17 00:00:00 2001 From: Abrarahmed Momin Date: Fri, 3 Mar 2017 19:14:23 +0530 Subject: [PATCH] LU-5361 llite: Remove OBD_FAIL_OSC_CONNECT_CKSUM Remove OBD_FAIL_OSC_CONNECT_CKSUM as all clients and servers since 1.8 support OBD_CONNECT_CKSUM. No reason to check interoperability with older servers anymore. Remove sanity test_77i(), update test_77j(). Fix _wait_osc_import_state() to fetch OST state when facet is client. Seagate-bug-id: MRP-1421 Signed-off-by: Abrarahmed Momin Change-Id: I664f50bc8dbd3a169bcb7e42706717416d6e1006 Reviewed-on: https://review.whamcloud.com/23644 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- lustre/include/obd_support.h | 2 +- lustre/llite/llite_lib.c | 22 ++++++++++------------ lustre/ofd/ofd_obd.c | 6 +++--- lustre/ptlrpc/import.c | 16 +++++++--------- lustre/tests/sanity.sh | 29 +++++++++-------------------- lustre/tests/test-framework.sh | 5 ++--- 6 files changed, 32 insertions(+), 48 deletions(-) diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index fdf2a3b..0c47add 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -386,7 +386,7 @@ extern char obd_jobid_var[]; #define OBD_FAIL_OSC_CHECKSUM_RECEIVE 0x408 #define OBD_FAIL_OSC_CHECKSUM_SEND 0x409 #define OBD_FAIL_OSC_BRW_PREP_REQ2 0x40a -#define OBD_FAIL_OSC_CONNECT_CKSUM 0x40b +/* #define OBD_FAIL_OSC_CONNECT_CKSUM 0x40b Obsolete since 2.9 */ #define OBD_FAIL_OSC_CKSUM_ADLER_ONLY 0x40c #define OBD_FAIL_OSC_DIO_PAUSE 0x40d #define OBD_FAIL_OSC_OBJECT_CONTENTION 0x40e diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 4d80ff5..88505aa 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -401,18 +401,16 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, if (!OBD_FAIL_CHECK(OBD_FAIL_OSC_CONNECT_GRANT_PARAM)) data->ocd_connect_flags |= OBD_CONNECT_GRANT_PARAM; - if (!OBD_FAIL_CHECK(OBD_FAIL_OSC_CONNECT_CKSUM)) { - /* OBD_CONNECT_CKSUM should always be set, even if checksums are - * disabled by default, because it can still be enabled on the - * fly via /proc. As a consequence, we still need to come to an - * agreement on the supported algorithms at connect time */ - data->ocd_connect_flags |= OBD_CONNECT_CKSUM; - - if (OBD_FAIL_CHECK(OBD_FAIL_OSC_CKSUM_ADLER_ONLY)) - data->ocd_cksum_types = OBD_CKSUM_ADLER; - else - data->ocd_cksum_types = cksum_types_supported_client(); - } + /* OBD_CONNECT_CKSUM should always be set, even if checksums are + * disabled by default, because it can still be enabled on the + * fly via /proc. As a consequence, we still need to come to an + * agreement on the supported algorithms at connect time */ + data->ocd_connect_flags |= OBD_CONNECT_CKSUM; + + if (OBD_FAIL_CHECK(OBD_FAIL_OSC_CKSUM_ADLER_ONLY)) + data->ocd_cksum_types = OBD_CKSUM_ADLER; + else + data->ocd_cksum_types = cksum_types_supported_client(); #ifdef HAVE_LRU_RESIZE_SUPPORT data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE; diff --git a/lustre/ofd/ofd_obd.c b/lustre/ofd/ofd_obd.c index 9092ca8..2134233 100644 --- a/lustre/ofd/ofd_obd.c +++ b/lustre/ofd/ofd_obd.c @@ -262,10 +262,10 @@ static int ofd_parse_connect_data(const struct lu_env *env, "%x\n", exp->exp_obd->obd_name, obd_export_nid2str(exp), cksum_types, data->ocd_cksum_types); } else { - /* This client does not support OBD_CONNECT_CKSUM - * fall back to CRC32 */ + /* This client does not support OBD_CONNECT_CKSUM. + * Report failure to negotiate checksum at connect */ CDEBUG(D_RPCTRACE, "%s: cli %s does not support " - "OBD_CONNECT_CKSUM, CRC32 will be used\n", + "OBD_CONNECT_CKSUM\n", exp->exp_obd->obd_name, obd_export_nid2str(exp)); } diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index 525ff1f..0181b53 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -867,15 +867,13 @@ static int ptlrpc_connect_set_flags(struct obd_import *imp, * the checksum types it doesn't support */ if ((ocd->ocd_cksum_types & cksum_types_supported_client()) == 0) { - LCONSOLE_WARN("The negotiation of the checksum " - "alogrithm to use with server %s " - "failed (%x/%x), disabling " - "checksums\n", - obd2cli_tgt(imp->imp_obd), - ocd->ocd_cksum_types, - cksum_types_supported_client()); - cli->cl_checksum = 0; - cli->cl_supp_cksum_types = OBD_CKSUM_ADLER; + LCONSOLE_ERROR("The negotiation of the checksum " + "alogrithm to use with server %s " + "failed (%x/%x)\n", + obd2cli_tgt(imp->imp_obd), + ocd->ocd_cksum_types, + cksum_types_supported_client()); + return -EPROTO; } else { cli->cl_supp_cksum_types = ocd->ocd_cksum_types; } diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 0b08267..3f9cc8e5 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -6090,22 +6090,6 @@ test_77g() { # bug 10889 } run_test 77g "checksum error on OST write, read" -test_77i() { # bug 13805 - [ $PARALLEL == "yes" ] && skip "skip parallel run" && return - $GSS && skip "could not run with gss" && return - #define OBD_FAIL_OSC_CONNECT_CKSUM 0x40b - lctl set_param fail_loc=0x40b - remount_client $MOUNT - lctl set_param fail_loc=0 - for VALUE in `lctl get_param osc.*osc-[^mM]*.checksum_type`; do - PARAM=`echo ${VALUE[0]} | cut -d "=" -f1` - algo=`lctl get_param -n $PARAM | sed 's/.*\[\(.*\)\].*/\1/g'` - [ "$algo" = "adler" ] || error "algo set to $algo instead of adler" - done - remount_client $MOUNT -} -run_test 77i "client not supporting OSD_CONNECT_CKSUM" - test_77j() { # bug 13805 [ $PARALLEL == "yes" ] && skip "skip parallel run" && return $GSS && skip "could not run with gss" && return @@ -6113,10 +6097,15 @@ test_77j() { # bug 13805 lctl set_param fail_loc=0x40c remount_client $MOUNT lctl set_param fail_loc=0 - sleep 2 # wait async osc connect to finish - for VALUE in `lctl get_param osc.*osc-[^mM]*.checksum_type`; do - PARAM=`echo ${VALUE[0]} | cut -d "=" -f1` - algo=`lctl get_param -n $PARAM | sed 's/.*\[\(.*\)\].*/\1/g'` + # wait async osc connect to finish and reflect updated state value + local i + for (( i=0; i < OSTCOUNT; i++ )) ; do + wait_osc_import_state client ost$((i+1)) FULL + done + + for VALUE in $(lctl get_param osc.*osc-[^mM]*.checksum_type); do + PARAM=$(echo ${VALUE[0]} | cut -d "=" -f1) + algo=$(lctl get_param -n $PARAM | sed 's/.*\[\(.*\)\].*/\1/g') [ "$algo" = "adler" ] || error "algo set to $algo instead of adler" done remount_client $MOUNT diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index d27cb30..37e8475 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -6020,9 +6020,8 @@ _wait_osc_import_state() { if [[ $facet == client* ]]; then # During setup time, the osc might not be setup, it need wait - # until list_param can return valid value. And also if there - # are mulitple osc entries we should list all of them before - # go to wait. + # until list_param can return valid value. + param="osc.${ost%?}[^mM]*.ost_server_uuid" params=$($LCTL list_param $param 2>/dev/null || true) while [ -z "$params" ]; do if [ $i -ge $maxtime ]; then -- 1.8.3.1