Message ID | tencent_AB577926C13364C3696965A3A2244B776605@qq.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-2509-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp608624dyi; Sun, 17 Dec 2023 00:44:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IETn7+YwPgcGtD7p0zkbR3gqUHY4cExtDGYw1q5gSGLxVzeMnoDgFGbYo7YAAoDse/Zo6FS X-Received: by 2002:a05:6e02:218c:b0:35f:ad2d:3ec7 with SMTP id j12-20020a056e02218c00b0035fad2d3ec7mr319459ila.22.1702802662475; Sun, 17 Dec 2023 00:44:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702802662; cv=none; d=google.com; s=arc-20160816; b=LwZ3aH6MMTa9EqMwLVtXIrhdaQmsVUu4fcx42lu8vpwDwcbk2Fo0Dwii9OrgOXbS2Y Yst/bTJmUc9EaCH48dGr+Pb2EYGqlLKclnAVOJYd3r7v/W9BzTvow6ONmUouu18yw5vr rSvICdSlaLSWFlwHuVWKzT/0qhYh93qm00Mo1zKUiVKd6rE/t6fxvWnPz8spXmRmyOTv CFIwkUu5VdpPceM7Wryc9zotPMLXuJKH4MTeWg2e5a3ksI8oqBrOK3Vgs5vfQqs3Sfjx b92+idsQKiIFOdX39gXyQ4Ik4Fh5OI39zCRh5Ai7Mhd+JyBkshxDpKEBCNRXIKSf3TTI OaKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:date :subject:cc:to:from:message-id:dkim-signature; bh=Cu0nA0cgoDEd9tG8+d+j50FSTxVeILTQkKFvK9DqtUM=; fh=F4F9O5dkf+tKtR/LvTqh+LNAAJKFeOH//+ETIT85wkI=; b=D3fHtZCSvhleoE+mN3bPoN+FqoDxlcusz5wa0KTaWEKolmDDMUJ/t2OtNRJ2aiCkFF 1vK+zCR3O/5/SYSowudDLZsFBBw0ipEiaYWRuFgmGZfhDl39gZ/37hB2GIPIXWFYMi+9 Ucq78VrqUHcz5Oz5csLOfE0UrIpod2rCAOU3vHTJpeuOPGBx2FnN5lxLjuQ3+YwnzQza Xk5uIFLX3GZpaCImF1L0Y99a3eA3slFcmbKqyDYG/d595SB5vEsgYIzdv6Cg3yLm+hjW Q/XIbahjYTikQeylOyUvq2RiEyHN6rPnZeEk6fuJturcjx7HkRx9fFtxldHoEaOeuii9 iGWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@qq.com header.s=s201512 header.b=c8u6Ajyy; spf=pass (google.com: domain of linux-kernel+bounces-2509-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2509-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=qq.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u8-20020a63df08000000b005b8ebaa2937si16512440pgg.47.2023.12.17.00.44.22 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 00:44:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2509-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@qq.com header.s=s201512 header.b=c8u6Ajyy; spf=pass (google.com: domain of linux-kernel+bounces-2509-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2509-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=qq.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 85065284540 for <ouuuleilei@gmail.com>; Sun, 17 Dec 2023 08:37:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C13A259B; Sun, 17 Dec 2023 08:37:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b="c8u6Ajyy" X-Original-To: linux-kernel@vger.kernel.org Received: from out162-62-58-211.mail.qq.com (out162-62-58-211.mail.qq.com [162.62.58.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6BC01C17; Sun, 17 Dec 2023 08:37:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qq.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1702802246; bh=Cu0nA0cgoDEd9tG8+d+j50FSTxVeILTQkKFvK9DqtUM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=c8u6AjyyLwuw/cwAd//5d6Ts+Rokd2xosKplpbJeXFMed2SZYBabFSnHloObEStjM n+hc4Ob6rlcGpMzIbPEGOKJgwVcVEJ9pdsuBSHY+DSO/h76nyAsWPa2htoQsFvHckc ju7kEIjZw2eibsdLeWCN0JA8/ywc3PYyaFcDDZe0= Received: from pek-lxu-l1.wrs.com ([111.198.225.215]) by newxmesmtplogicsvrszc5-2.qq.com (NewEsmtp) with SMTP id 881A00AA; Sun, 17 Dec 2023 16:34:01 +0800 X-QQ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X-QQ-XMRINFO: Mp0Kj//9VHAxr69bL5MkOOs= From: Edward Adam Davis <eadavis@qq.com> To: syzbot+4da851837827326a7cd4@syzkaller.appspotmail.com Cc: axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: [PATCH next] nbd: fix task hung in bdev_release Date: Sun, 17 Dec 2023 16:34:02 +0800 X-OQ-MSGID: <20231217083401.4160650-2-eadavis@qq.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <000000000000098af2060b5ff161@google.com> References: <000000000000098af2060b5ff161@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785518004932551517 X-GMAIL-MSGID: 1785518004932551517 |
Series |
[next] nbd: fix task hung in bdev_release
|
|
Commit Message
Edward Adam Davis
Dec. 17, 2023, 8:34 a.m. UTC
If the nbd timeout value is not set before calling nbd_start_device_ioctl(),
so the socket will be disabled disconnection, which will cause the timer to
only be reset and cause this 143 second timeout issue.
The solution I have provided here is to set the default timeout value for nbd in
nbd_start_device() to avoid problems from occurring.
Reported-and-tested-by: syzbot+4da851837827326a7cd4@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
drivers/block/nbd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index b6414e1e645b..31656364d8a3 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -1394,6 +1394,9 @@ static int nbd_start_device(struct nbd_device *nbd) } set_bit(NBD_RT_HAS_PID_FILE, &config->runtime_flags); + if (num_connections == 1 && !nbd->tag_set.timeout) + nbd->tag_set.timeout = HZ * 1024; + nbd_dev_dbg_init(nbd); for (i = 0; i < num_connections; i++) { struct recv_thread_args *args;