From patchwork Wed May 23 12:19: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: 10421067 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 22BC56016C for ; Wed, 23 May 2018 12:20:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 136A928E0D for ; Wed, 23 May 2018 12:20:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07D3628F44; Wed, 23 May 2018 12:20:35 +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 CEE6228F64 for ; Wed, 23 May 2018 12:20:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932883AbeEWMUa (ORCPT ); Wed, 23 May 2018 08:20:30 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:37652 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932534AbeEWMU1 (ORCPT ); Wed, 23 May 2018 08:20:27 -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=G7NITm/qyvJA4kuNYwozf6u2q/W/e5wExjfdpamIX9A=; b=BJy2Lm9ID+z8eGgbjBOMu8TcX 5OJ9MnEg3h2gO7VmveJb/bF5mjgbVBvCavDsHgn8pp8+WXmqe6KCyBFUVMVSTfugaH5gtAbIwlKa5 7revG5z155+pVzg2X7Dz4WymHZRtf6SymIXJlIgc/pJqHwHr3qtphCam5GNDiQPJxcNY+Bc9BiQj6 hqVj0LrwhH23EimQWjafIL434IfFdheVw1/JgrwQ/3b54cplhLhL9dTtcPDVcIXYWp+wLaddnZlzM VzLfbWHTJ8hi5rkYb4L9Et5JpwIGUQft1oPppLqiFTNXpg1NdTFRA99HeEFdId88U0s9dU2BPQ/GL LgQVmeGdw==; Received: from clnet-p01-149.ikbnet.co.at ([83.175.85.149] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLSkh-0002Wa-4H; Wed, 23 May 2018 12:20:24 +0000 From: Christoph Hellwig To: Jens Axboe , Keith Busch Cc: Bart Van Assche , Ming Lei , Josef Bacik , Tejun Heo , Lee Duncan , Chris Leech , Rafael David Tinoco , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [PATCH 04/14] nbd: complete requests from ->timeout Date: Wed, 23 May 2018 14:19:31 +0200 Message-Id: <20180523121941.8632-5-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180523121941.8632-1-hch@lst.de> References: <20180523121941.8632-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 09d9959287fe..30a851b8a99c 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -300,7 +300,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; @@ -338,8 +338,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; } /*