Whamcloud - gitweb
LU-7159 tests: fix 224c fault injection 26/16426/20
authorArtem Blagodarenko <artem.blagodarenko@seagate.com>
Tue, 15 Sep 2015 09:18:41 +0000 (12:18 +0300)
committerOleg Drokin <green@whamcloud.com>
Wed, 23 Jan 2019 09:19:21 +0000 (09:19 +0000)
Sanity 224c test always passes because no fault injection happened.

This Patch adds additional step in fault injection and fix this test.

Test-Parameters: clientarch=aarch64 testlist=node-provisioning-1,lustre-initialization-1,lnet-selftest,sanity

Signed-off-by: Artem Blagodarenko <artem.blagodarenko@seagate.com>
Xyratex-bug-id: MRP-2472
Change-Id: I5f637e98b46ddda6acbafb956f9b85fccb7cae15
Reviewed-on: https://review.whamcloud.com/16426
Reviewed-by: Alexander Zarochentsev <c17826@cray.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
libcfs/include/libcfs/libcfs_fail.h
lnet/include/lnet/lib-lnet.h
lnet/lnet/lib-move.c
lustre/include/obd_support.h
lustre/ptlrpc/niobuf.c
lustre/tests/sanity.sh

index 2af5149..d3651f8 100644 (file)
@@ -49,6 +49,10 @@ enum {
         CFS_FAIL_LOC_VALUE      = 3
 };
 
+/* Failure ranges
+       "0x0100 - 0x3fff" for Lustre
+       "0xe000 - 0xefff" for LNet
+       "0xf000 - 0xffff" for LNDs */
 /* Failure injection control */
 #define CFS_FAIL_MASK_SYS    0x0000FF00
 #define CFS_FAIL_MASK_LOC   (0x000000FF | CFS_FAIL_MASK_SYS)
index c99d49b..8bca9f2 100644 (file)
@@ -37,6 +37,9 @@
 #ifndef __LNET_LIB_LNET_H__
 #define __LNET_LIB_LNET_H__
 
+/* LNET has 0xeXXX */
+#define CFS_FAIL_PTLRPC_OST_BULK_CB2   0xe000
+
 #ifndef __KERNEL__
 # error This include is only for kernel use.
 #endif
index 6d2ac7a..5b933a2 100644 (file)
@@ -4590,7 +4590,12 @@ LNetPut(lnet_nid_t self, struct lnet_handle_md mdh, enum lnet_ack_req ack,
        if (ack == LNET_ACK_REQ)
                lnet_attach_rsp_tracker(rspt, cpt, md, mdh);
 
-       rc = lnet_send(self, msg, LNET_NID_ANY);
+       if (CFS_FAIL_CHECK_ORSET(CFS_FAIL_PTLRPC_OST_BULK_CB2,
+                                CFS_FAIL_ONCE))
+               rc = -EIO;
+       else
+               rc = lnet_send(self, msg, LNET_NID_ANY);
+
        if (rc != 0) {
                CNETERR("Error sending PUT to %s: %d\n",
                        libcfs_id2str(target), rc);
index 60d7c9b..4cc253d 100644 (file)
@@ -676,6 +676,7 @@ extern char obd_jobid_var[];
 
 #define OBD_FAIL_OSD_FAIL_AT_TRUNCATE          0x2301
 
+/* LNet is allocated failure locations 0xe000 to 0xffff */
 /* Assign references to moved code to reduce code changes */
 #define OBD_FAIL_PRECHECK(id)                   CFS_FAIL_PRECHECK(id)
 #define OBD_FAIL_CHECK(id)                      CFS_FAIL_CHECK(id)
index 86dc511..503ce69 100644 (file)
@@ -37,6 +37,7 @@
 #include <obd.h>
 #include <obd_class.h>
 #include "ptlrpc_internal.h"
+#include <lnet/lib-lnet.h> /* for CFS_FAIL_PTLRPC_OST_BULK_CB2 */
 
 /**
  * Helper function. Sends \a len bytes from \a base at offset \a offset
@@ -216,13 +217,10 @@ int ptlrpc_start_bulk_transfer(struct ptlrpc_bulk_desc *desc)
                        break;
                }
 
-               /* LU-6441: last md is not sent and desc->bd_md_count == 1 */
-               if (OBD_FAIL_CHECK_ORSET(OBD_FAIL_PTLRPC_CLIENT_BULK_CB3,
-                                        CFS_FAIL_ONCE) &&
-                   total_md > 1 && posted_md == total_md - 1) {
-                       posted_md++;
-                       continue;
-               }
+               /* sanity.sh 224c: lets skip last md */
+               if (posted_md == desc->bd_md_max_brw - 1)
+                       OBD_FAIL_CHECK_RESET(OBD_FAIL_PTLRPC_CLIENT_BULK_CB3,
+                                            CFS_FAIL_PTLRPC_OST_BULK_CB2);
 
                /* Network is about to get at the memory */
                if (ptlrpc_is_bulk_put_source(desc->bd_type))
index aa4f738..47b8c73 100755 (executable)
@@ -14628,12 +14628,12 @@ test_224c() { # LU-6441
        set_persistent_param_and_check client "$test_at" "$param_at" 0
        set_persistent_param_and_check client "$test_timeout" "$param_timeout" 5
 
-       #define OBD_FAIL_PTLRPC_CLIENT_BULK_CB3   0x520
-       do_facet ost1 $LCTL set_param fail_loc=0x520
+       #define OBD_FAIL_PTLRPC_CLIENT_BULK_CB3 0x520
+       do_facet ost1 "$LCTL set_param fail_loc=0x520"
        $LFS setstripe -c 1 -i 0 $DIR/$tfile
        dd if=/dev/zero of=$DIR/$tfile bs=8MB count=1
        sync
-       do_facet ost1 $LCTL set_param fail_loc=0
+       do_facet ost1 "$LCTL set_param fail_loc=0"
 
        set_persistent_param_and_check client "$test_at" "$param_at" $at_max
        set_persistent_param_and_check client "$test_timeout" "$param_timeout" \