From patchwork Fri Jun 22 20:18:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10482989 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 B14B860383 for ; Fri, 22 Jun 2018 20:18:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1FF829004 for ; Fri, 22 Jun 2018 20:18:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9201429007; Fri, 22 Jun 2018 20:18:12 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham 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 2448C29004 for ; Fri, 22 Jun 2018 20:18:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754089AbeFVUSL (ORCPT ); Fri, 22 Jun 2018 16:18:11 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:58212 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624AbeFVUSK (ORCPT ); Fri, 22 Jun 2018 16:18:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1529698691; x=1561234691; h=from:to:cc:subject:date:message-id; bh=Z+xmc6mtfSLljtxUp2oOQdMzYylDVs2Q95h0smEoUuc=; b=q/pvzzAzScx0dCKJflz0RzrIrM+jcSFbte5Xk3Gd+BgZti5blvHySAB4 SK5TuiikEhRrMdl8XtTWD0TgO6E5oR1e3yLHJMm7YYPs/Z+Psi5d0s+zV RwTZuzI9z6oPyWcJBL1r9Z7QCu8g+VkyZFk92yCG8Y9KAnt6JPVPmvTp0 NFZvlyxDjg+h7QEp37Y0MY3kwFp7/+yyt/QfdKGjdoq5cC8r2rsrlJQWs 5YR3dHDJoXepVh7bgZX3SjQG/JxIBmYLI/y8bT99pahnJl6jwjyik0oE8 TSPw5wASdLhScx7mgqkkqCM5BpSI0yrC+AXIrCBEghk9CH6868eKvvJCE g==; X-IronPort-AV: E=Sophos;i="5.51,258,1526313600"; d="scan'208";a="81344736" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 23 Jun 2018 04:18:10 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 22 Jun 2018 13:07:58 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip02.wdc.com with ESMTP; 22 Jun 2018 13:18:11 -0700 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Jianchao Wang , Andrew Randrianasulu Subject: [PATCH] blk-mq: Fix timeout handling in case the timeout handler returns BLK_EH_DONE Date: Fri, 22 Jun 2018 13:18:09 -0700 Message-Id: <20180622201809.25519-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.17.1 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 Make sure that RQF_TIMED_OUT is cleared when a request is reused after a block driver timeout handler has returned BLK_EH_DONE. Fixes: da6612673988 ("blk-mq: don't time out requests again that are in the timeout handler") Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Jianchao Wang Cc: Andrew Randrianasulu --- block/blk-mq.c | 1 - block/blk-timeout.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index b97cb6fed3bd..8c00fcd300b9 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -785,7 +785,6 @@ static void blk_mq_rq_timed_out(struct request *req, bool reserved) WARN_ON_ONCE(ret != BLK_EH_RESET_TIMER); } - req->rq_flags &= ~RQF_TIMED_OUT; blk_add_timer(req); } diff --git a/block/blk-timeout.c b/block/blk-timeout.c index c788255b18ad..d72e9071b17f 100644 --- a/block/blk-timeout.c +++ b/block/blk-timeout.c @@ -213,6 +213,7 @@ void blk_add_timer(struct request *req) if (!req->timeout) req->timeout = q->rq_timeout; + req->rq_flags &= ~RQF_TIMED_OUT; blk_rq_set_deadline(req, jiffies + req->timeout); /*