From: Artem Blagodarenko Date: Tue, 15 Sep 2015 09:18:41 +0000 (+0300) Subject: LU-7159 tests: fix 224c fault injection X-Git-Tag: 2.12.51~27 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=707820692275a448eaaf18f4fa5312cff47384be LU-7159 tests: fix 224c fault injection 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 Xyratex-bug-id: MRP-2472 Change-Id: I5f637e98b46ddda6acbafb956f9b85fccb7cae15 Reviewed-on: https://review.whamcloud.com/16426 Reviewed-by: Alexander Zarochentsev Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Mike Pershin --- diff --git a/libcfs/include/libcfs/libcfs_fail.h b/libcfs/include/libcfs/libcfs_fail.h index 2af5149..d3651f8 100644 --- a/libcfs/include/libcfs/libcfs_fail.h +++ b/libcfs/include/libcfs/libcfs_fail.h @@ -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) diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index c99d49b..8bca9f2 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -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 diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index 6d2ac7a..5b933a2 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -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); diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index 60d7c9b..4cc253d 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -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) diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 86dc511..503ce69 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -37,6 +37,7 @@ #include #include #include "ptlrpc_internal.h" +#include /* 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)) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index aa4f738..47b8c73 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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" \