From patchwork Tue May 29 13:52:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10435505 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 D5AEC601E9 for ; Tue, 29 May 2018 13:55:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDE52287AE for ; Tue, 29 May 2018 13:55:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B03D9287ED; Tue, 29 May 2018 13:55:51 +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 E446B28C19 for ; Tue, 29 May 2018 13:53:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934655AbeE2NxD (ORCPT ); Tue, 29 May 2018 09:53:03 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:36328 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934099AbeE2NxB (ORCPT ); Tue, 29 May 2018 09:53:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VvSrSHkTUOkeG8kpPgMVa2KJyL/PI9iou1igP97RgY4=; b=Y8Jg1gexgNTiy1ZjpjTSKZe4x z2t2ZPAlVWvndDkGpM4qgQnBx2rxQbe39t5zFRXv8W4dgurPOzQIfdJo0TikGose4rGIBLhTKDbrP yc+P4JHDPv1sc2A/rC+EgvH84G59j65hRmHAobvVrXgS9vdxCTcmrdmvy5qo9YUiaqEO/92esMgU2 qQWWiNSt3misjs52vX7jaB6BaYNlH6T5UYF3pYgt/xWU/BlTox9mLVMWMAlcQuYKiG3NPcsi/hqeL hVQhdnpLnJ8/H2F7nFubCr68LL7gFo81IqnfbkO3IS6a78Nb0teN8VcwECAlxG2Qy9q8gOY2rTgAM CY9hkXuxg==; Received: from 80-109-164-210.cable.dynamic.surfer.at ([80.109.164.210] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fNf3a-0001Ph-Tu; Tue, 29 May 2018 13:52:59 +0000 From: Christoph Hellwig To: Jens Axboe , Keith Busch Cc: Bart Van Assche , Ming Lei , Josef Bacik , Tejun Heo , Lee Duncan , Chris Leech , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [PATCH 06/14] nbd: complete requests from ->timeout Date: Tue, 29 May 2018 15:52:31 +0200 Message-Id: <20180529135239.27005-7-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180529135239.27005-1-hch@lst.de> References: <20180529135239.27005-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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 By completing the request entirely in the driver we can remove the BLK_EH_HANDLED return value and thus the split responsibility between the driver and the block layer that has been causing trouble. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/nbd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 88ae833aabe9..8860b24098bc 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -304,7 +304,7 @@ static enum blk_eh_timer_return nbd_xmit_timeout(struct request *req, if (!refcount_inc_not_zero(&nbd->config_refs)) { cmd->status = BLK_STS_TIMEOUT; - return BLK_EH_HANDLED; + goto done; } config = nbd->config; @@ -342,8 +342,9 @@ static enum blk_eh_timer_return nbd_xmit_timeout(struct request *req, cmd->status = BLK_STS_IOERR; sock_shutdown(nbd); nbd_config_put(nbd); - - return BLK_EH_HANDLED; +done: + blk_mq_complete_request(req); + return BLK_EH_DONE; } /*