Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4186662pxk; Tue, 8 Sep 2020 12:59:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7QGD8mgJL9Oif9NO5gKY0oGSGrGgJuxNCkapoi0xNY1iWmgL/+//O9LZwt23WJcvkDPYs X-Received: by 2002:a05:6402:1a48:: with SMTP id bf8mr703816edb.298.1599595162375; Tue, 08 Sep 2020 12:59:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599595162; cv=none; d=google.com; s=arc-20160816; b=bbTyvncdkMHVpPu5svy9JrgVBDQ+yT71DPyet4rbiiFISoMfLJcIzMFp5Xj3IaNz10 iF0AghQB55KBrnhkJI/qkws3ZkLOUVNuZUGYP7NtkXI0O2MTg8gxXmctpB+4qyrdSLns syR78nHGqMqp7VFGC+lJKXvB+yjQdK6h0xbpIwaSmkSr7kA72OpHsZ2crptllZSAXpdZ oSyXQ3nPQFXysova3qW2ZkfJp22YU1PSz/RCnHouVVqO32PkIJUO95PgkHhEtpJEL3Vr U7na5l8xfvwOszYAkFyZ9WknBfmn5uuZegqOZZulpziLrO3KQLKeRg1mcKs1wa6VV2Wj qZuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H258/RjSPIftnkxF4ghF5RPmrN2WtU+3zEF0CmBPCVQ=; b=nsuOQwyNNA7btYL4Ti/HAJGA+RWtL8WCsFDcstWQdQxstnWia4l1THPWMTHy0vCByj Jo5JNCAYtNmSQQQFWTq8Fd1LVU8/deyNylZ+/5l52srT9uzfl9fRNsm2uJjPRJGJ004T cdtvMhlnePkG+oNoQ40NaEMul+0jssCmE0dTf49lB6s+ng1ZtXod0MJ4wey1VybFDUYG bd5bPL8r5buarNtPGKIsSbDSY7+5ker2zPRACSCSiSOyvJw09whCsMC4dZRNg+w3rY6k V3uzyYModn285HWFZ1Unn2vTa2hvvAdz1uy9QStyapZqjDrU6Y4IcpVEiJKMLlYCF9PA DPvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K+xBNi2Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c15si70853eds.227.2020.09.08.12.58.59; Tue, 08 Sep 2020 12:59:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K+xBNi2Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732505AbgIHT4J (ORCPT + 99 others); Tue, 8 Sep 2020 15:56:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:58864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730577AbgIHPgu (ORCPT ); Tue, 8 Sep 2020 11:36:50 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2995F22582; Tue, 8 Sep 2020 15:35:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599579315; bh=ht+MpGssPKdJ6E3rsvdmycBCNz+RMWwRINpMqFlTCqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K+xBNi2Q+LKxAfSmMOo0Ia0Y0dez09p4Iu6JGdOKj8tT0hMqK9tcb9HlJpThbIuni /UuU2l+wqzHJpuag+o0t1g3hNphmPom1ydp2YVI07Of1qBZh63S7KEMhRZT+I5YkDI BLXPRs5z51bfp9sXcRX0cCh7hytrqgj24yNPAL1Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hou Pu , Josef Bacik , Jens Axboe , Sasha Levin Subject: [PATCH 5.8 027/186] nbd: restore default timeout when setting it to zero Date: Tue, 8 Sep 2020 17:22:49 +0200 Message-Id: <20200908152242.972650373@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908152241.646390211@linuxfoundation.org> References: <20200908152241.646390211@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hou Pu [ Upstream commit acb19e17c5134dd78668c429ecba5b481f038e6a ] If we configured io timeout of nbd0 to 100s. Later after we finished using it, we configured nbd0 again and set the io timeout to 0. We expect it would timeout after 30 seconds and keep retry. But in fact we could not change the timeout when we set it to 0. the timeout is still the original 100s. So change the timeout to default 30s when we set it to zero. It also behaves same as commit 2da22da57348 ("nbd: fix zero cmd timeout handling v2"). It becomes more important if we were reconfigure a nbd device and the io timeout it set to zero. Because it could take 30s to detect the new socket and thus io could be completed more quickly compared to 100s. Signed-off-by: Hou Pu Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/block/nbd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index ce7e9f223b20b..bc9dc1f847e19 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -1360,6 +1360,8 @@ static void nbd_set_cmd_timeout(struct nbd_device *nbd, u64 timeout) nbd->tag_set.timeout = timeout * HZ; if (timeout) blk_queue_rq_timeout(nbd->disk->queue, timeout * HZ); + else + blk_queue_rq_timeout(nbd->disk->queue, 30 * HZ); } /* Must be called with config_lock held */ -- 2.25.1