Whamcloud - gitweb
LU-5361 llite: Remove OBD_FAIL_OSC_CONNECT_CKSUM 44/23644/4
authorAbrarahmed Momin <abrar.habib@seagate.com>
Fri, 3 Mar 2017 13:44:23 +0000 (19:14 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 14 Mar 2017 02:58:17 +0000 (02:58 +0000)
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 <abrar.habib@seagate.com>
Change-Id: I664f50bc8dbd3a169bcb7e42706717416d6e1006
Reviewed-on: https://review.whamcloud.com/23644
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/obd_support.h
lustre/llite/llite_lib.c
lustre/ofd/ofd_obd.c
lustre/ptlrpc/import.c
lustre/tests/sanity.sh
lustre/tests/test-framework.sh

index fdf2a3b..0c47add 100644 (file)
@@ -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
index 4d80ff5..88505aa 100644 (file)
@@ -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;
index 9092ca8..2134233 100644 (file)
@@ -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));
        }
 
index 525ff1f..0181b53 100644 (file)
@@ -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;
                }
index 0b08267..3f9cc8e 100755 (executable)
@@ -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
index d27cb30..37e8475 100755 (executable)
@@ -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