From patchwork Fri Mar 24 18:08:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 9643593 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 1A15D60327 for ; Fri, 24 Mar 2017 18:11:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10430201BD for ; Fri, 24 Mar 2017 18:11:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 049A1269DA; Fri, 24 Mar 2017 18:11:06 +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.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 8F59B201BD for ; Fri, 24 Mar 2017 18:11:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753824AbdCXSKj (ORCPT ); Fri, 24 Mar 2017 14:10:39 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:35607 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932944AbdCXSIm (ORCPT ); Fri, 24 Mar 2017 14:08:42 -0400 Received: by mail-qt0-f194.google.com with SMTP id r5so1432051qtb.2 for ; Fri, 24 Mar 2017 11:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cpuZT0U1c8D9by4rUFDLLpBRSF1M5k5eKe76JYnTUGQ=; b=Nu/a5jidN998/A89LmMONg+w56hbmAuUTduElik4+DH+LhxU4bp/WXVhmyVGVORXZC w3LP2KfmgS6rp4RhiJTSNMKr9INuGjxG6znkGycpVD9WMFzGWgW3++dZWtdHiOaVvpFZ 0nhX1KlsYMWupCKcl2Nge8YQo8Dti97hmdAdlQGoBirvGRSuAKg34dVN+IOlt3NytYXW KMs11LzUUSCoyCorKiqovMAWUL0HaMfaTczwR3RsC4OdkQAn8JBkr3VrWW7TzxuRO5Lt uZ0iM5r1JLB36O7v8QzJAXkBXsmCyIKFF2v0sWAWE5tEZ0pTXSL4qaylI++nVpG7TGfE 8J/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cpuZT0U1c8D9by4rUFDLLpBRSF1M5k5eKe76JYnTUGQ=; b=sCJpuSIRG9pI0c9bEeU5vdvOQr7qe/P2A1ec+wOLZ+Xd/hQ2rvEIKkmWpDWZegVLPq CP7UyKbr/nkikL3+9h8bhyNfU4Cocy4xTxZBNfGmRWN6VEaLjzd8Vt1jaHucIPJC7FNd y0DYnzpqUrLaLMbNopmwD4sjHp9suZLClNzpT92mI51DZfqqly7xn4m/2WP6nzeSCCfN pMcfhul/8sTpVovnNLULoGLitrEJgLtmlG4Mc2vCToSajBXmD7zR+4srETSqTtkDhMLB +N/S0NOBvHhVbLS+0U43904YEPOuPUjTQf7dSI7erwajcdybA9jCdshX5AQzsKaQiIkW 3abQ== X-Gm-Message-State: AFeK/H2eqJejssnVXnJiSDYLndc/vLPSR35ZuM5jdjAchW10d/n/wHJ9mdTVhOuvm6PuwA== X-Received: by 10.200.58.167 with SMTP id x36mr9802261qte.217.1490378920967; Fri, 24 Mar 2017 11:08:40 -0700 (PDT) Received: from localhost (cpe-2606-A000-4381-1201-225-22FF-FEB3-E51A.dyn6.twc.com. [2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id f128sm1978401qkd.62.2017.03.24.11.08.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Mar 2017 11:08:40 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, nbd-general@lists.sourceforge.net, linux-block@vger.kernel.org, kernel-team@fb.com Cc: Josef Bacik Subject: [PATCH 3/4] nbd: set queue timeout properly Date: Fri, 24 Mar 2017 14:08:28 -0400 Message-Id: <1490378909-4056-4-git-send-email-josef@toxicpanda.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490378909-4056-1-git-send-email-josef@toxicpanda.com> References: <1490378909-4056-1-git-send-email-josef@toxicpanda.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 From: Josef Bacik We can't just set the timeout on the tagset, we have to set it on the queue as it would have been setup already at this point. Signed-off-by: Josef Bacik --- drivers/block/nbd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index dbc22f4..b0003da 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -844,7 +844,10 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd, nbd_size_set(nbd, bdev, nbd->blksize, arg); return 0; case NBD_SET_TIMEOUT: - nbd->tag_set.timeout = arg * HZ; + if (arg) { + nbd->tag_set.timeout = arg * HZ; + blk_queue_rq_timeout(nbd->disk->queue, arg * HZ); + } return 0; case NBD_SET_FLAGS: