From patchwork Thu Feb 27 21:11:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11410017 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0DB4D138D for ; Thu, 27 Feb 2020 21:28:00 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA54A246A0 for ; Thu, 27 Feb 2020 21:27:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA54A246A0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 6BC8434921B; Thu, 27 Feb 2020 13:24:32 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id DABBB21FBC9 for ; Thu, 27 Feb 2020 13:19:18 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 9FC792AD2; Thu, 27 Feb 2020 16:18:15 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 9DEF8468; Thu, 27 Feb 2020 16:18:15 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:11:07 -0500 Message-Id: <1582838290-17243-200-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 199/622] lnet: add fault injection for bulk transfers X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Artem Blagodarenko An internal test was always passing due to nno fault injecytion happening. Add CFS_FAIL_PTLRPC_OST_BULK_CB2 to simulation a bulk transfer timeout. WC-bug-id: https://jira.whamcloud.com/browse/LU-7159 Lustre-commit: 707820692275 ("LU-7159 tests: fix 224c fault injection") Signed-off-by: Artem Blagodarenko Xyratex-bug-id: MRP-2472 Reviewed-on: https://review.whamcloud.com/16426 Reviewed-by: Alexander Zarochentsev Reviewed-by: Andreas Dilger Reviewed-by: Mike Pershin Signed-off-by: James Simmons --- fs/lustre/include/obd_support.h | 1 + include/linux/libcfs/libcfs_fail.h | 6 ++++++ include/linux/lnet/lib-lnet.h | 3 +++ net/lnet/lnet/lib-move.c | 6 +++++- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/fs/lustre/include/obd_support.h b/fs/lustre/include/obd_support.h index 5ff270a..d9a0395 100644 --- a/fs/lustre/include/obd_support.h +++ b/fs/lustre/include/obd_support.h @@ -487,6 +487,7 @@ #define OBD_FAIL_FLR_LV_INC 0x1A02 #define OBD_FAIL_FLR_RANDOM_PICK_MIRROR 0x1A03 +/* 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/include/linux/libcfs/libcfs_fail.h b/include/linux/libcfs/libcfs_fail.h index f52a82a..c341567 100644 --- a/include/linux/libcfs/libcfs_fail.h +++ b/include/linux/libcfs/libcfs_fail.h @@ -54,6 +54,12 @@ 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/include/linux/lnet/lib-lnet.h b/include/linux/lnet/lib-lnet.h index bbb678f..d09fb4c 100644 --- a/include/linux/lnet/lib-lnet.h +++ b/include/linux/lnet/lib-lnet.h @@ -49,6 +49,9 @@ #include #include +/* LNET has 0xeXXX */ +#define CFS_FAIL_PTLRPC_OST_BULK_CB2 0xe000 + extern struct lnet the_lnet; /* THE network */ #if (BITS_PER_LONG == 32) diff --git a/net/lnet/lnet/lib-move.c b/net/lnet/lnet/lib-move.c index 3bcac03..f5548eb 100644 --- a/net/lnet/lnet/lib-move.c +++ b/net/lnet/lnet/lib-move.c @@ -4323,7 +4323,11 @@ void lnet_monitor_thr_stop(void) 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) { CNETERR("Error sending PUT to %s: %d\n", libcfs_id2str(target), rc);