From patchwork Tue Aug 22 16:52:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9915741 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 298DB603FA for ; Tue, 22 Aug 2017 16:54:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3168B28600 for ; Tue, 22 Aug 2017 16:54:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 266DD28678; Tue, 22 Aug 2017 16:54:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EF9F28882 for ; Tue, 22 Aug 2017 16:54:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751859AbdHVQyI (ORCPT ); Tue, 22 Aug 2017 12:54:08 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:27729 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751858AbdHVQyI (ORCPT ); Tue, 22 Aug 2017 12:54:08 -0400 X-IronPort-AV: E=Sophos;i="5.41,412,1498492800"; d="scan'208";a="146773878" Received: from sjappemgw11.hgst.com (HELO sjappemgw12.hgst.com) ([199.255.44.62]) by ob1.hgst.iphmx.com with ESMTP; 23 Aug 2017 00:52:36 +0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.172.152]) by sjappemgw12.hgst.com with ESMTP; 22 Aug 2017 09:52:36 -0700 From: Bart Van Assche To: Andrew Morton Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Bart Van Assche , Jens Axboe , Dmitry Vyukov , Akinobu Mita , Michal Hocko Subject: [PATCH 2/2] block: Make I/O timeout failure injection support again task-independent Date: Tue, 22 Aug 2017 09:52:36 -0700 Message-Id: <20170822165236.12275-3-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20170822165236.12275-1-bart.vanassche@wdc.com> References: <20170822165236.12275-1-bart.vanassche@wdc.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit e41d58185f14 made all faults that are triggered from task context, including I/O timeouts, dependent on the failure injection settings for that task. Make it again possible to inject I/O timeout failures independent of task context. An example for a fault injection for which this patch makes a difference (from a VM booted with the 'threadirqs' command line parameter): FAULT_INJECTION: forcing a failure. name fail_io_timeout, interval 1, probability 100, space 0, times 1 CPU: 6 PID: 1253 Comm: irq/36-skd0-msi Not tainted 4.13.0-rc2-dbg+ #5 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1.fc26 04/01/2014 Call Trace: dump_stack+0x8e/0xcd should_fail+0x154/0x160 blk_should_fake_timeout+0x27/0x30 blk_mq_complete_request+0x11/0x30 skd_end_request+0x32/0xc0 [skd] skd_isr_completion_posted.isra.30+0x14a/0x400 [skd] skd_comp_q+0x40/0xb0 [skd] irq_forced_thread_fn+0x2a/0x70 irq_thread+0x144/0x1a0 kthread+0x125/0x140 ret_from_fork+0x2a/0x40 Fixes: commit e41d58185f14 ("fault-inject: support systematic fault injection") Signed-off-by: Bart Van Assche Cc: Jens Axboe Cc: Dmitry Vyukov Cc: Akinobu Mita Cc: Michal Hocko Cc: Andrew Morton --- block/blk-timeout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-timeout.c b/block/blk-timeout.c index 17ec83bb0900..2e92b20b125f 100644 --- a/block/blk-timeout.c +++ b/block/blk-timeout.c @@ -11,7 +11,7 @@ #ifdef CONFIG_FAIL_IO_TIMEOUT -static DECLARE_FAULT_ATTR(fail_io_timeout); +static DECLARE_GLOBAL_FAULT_ATTR(fail_io_timeout); static int __init setup_fail_io_timeout(char *str) {