Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1072919iob; Fri, 13 May 2022 22:03:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQBeroKDwCCFdV02XkkNCo4oExfET8Ts0re8d9H+teoAuO8W6xJiImnsmuwceupO1gQ/MN X-Received: by 2002:a1c:6a03:0:b0:395:ce4d:aeb1 with SMTP id f3-20020a1c6a03000000b00395ce4daeb1mr6166852wmc.88.1652504597446; Fri, 13 May 2022 22:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652504597; cv=none; d=google.com; s=arc-20160816; b=fexm5O9+19I8JWtVYkpGIyKl1HqqtLxay1mEV0YpGogXsgSVrau2FLjTVRtlp0VDzn JdlvZmyX2LtT0fpzvEa956C0sWus1OZqHlYAyybLHstsGVXy3a4+pmaY8H3MjkMnOLaL RluLd/IczxCrC0jw0tm5gOl0qE2LuY8lDSo9B7gtHJwvQpCPJlJpfrAwXPCWBmsWSEVy JK3X6bjt/5oCG1dkXHwCdJkZiUDu+gA4lruvXLzOHRoFNvOIECqIGjZ8M/uelB63DIpz MhZrDfYV9t26a2Uq8ZFG/M1NZ288tB4BCfkpVFTrrqNG4dr12X0Uz+n813RfPJGjxc8a B5IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=l+9vPHf53+y8SfpDAxS+UTM5qdEiElHGrjbfGtEcit4=; b=MINOe+/38BVUz4UK31OP3gjcdKMgenTH8tKmjz1CLGmkwi1tU4LbnkEpqZ81ogLXI5 8xM0oHcM3vXFiznboD/ENQIntHAlx10+f4wugxu4f8vfHQp8Dy+YVM12wfxJrIy+bzjR LL/XqVu+Objstsv3SnwkACGlbiCyvGITEIdizW1aZwIvCot4M19HoVjBrZ0BUofndCW+ xeK+t+0AOpFHBKNc4yXkz5A2oWbkwAxMB3Zm+zI9s1E4fvFkt4YO6/BftSqP0ijbTeLT /1Y77JcK+lKCBCq3iAE8BnUxcyUzevxMpjtRCga3yatCK3LjBmlK81h08F/C4nUW71mT eh6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t16-20020a5d5350000000b002060b2c217fsi3415301wrv.24.2022.05.13.22.03.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 22:03:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CCE18E15DC; Fri, 13 May 2022 20:39:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231588AbiENDjd (ORCPT + 99 others); Fri, 13 May 2022 23:39:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231515AbiENDjb (ORCPT ); Fri, 13 May 2022 23:39:31 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 482F95DA54; Fri, 13 May 2022 20:39:28 -0700 (PDT) Received: from kwepemi500011.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4L0WQW5THvzGpgL; Sat, 14 May 2022 11:36:35 +0800 (CST) Received: from kwepemm600009.china.huawei.com (7.193.23.164) by kwepemi500011.china.huawei.com (7.221.188.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 14 May 2022 11:39:26 +0800 Received: from [10.174.176.73] (10.174.176.73) by kwepemm600009.china.huawei.com (7.193.23.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 14 May 2022 11:39:26 +0800 Subject: Re: [PROBLEM] nbd requests become stuck when devices watched by inotify emit udev uevent changes To: Josef Bacik , Matthew Ruffell CC: Jens Axboe , linux-block , nbd , Linux Kernel References: <20220422054224.19527-1-matthew.ruffell@canonical.com> From: "yukuai (C)" Message-ID: <6efae367-12fa-1a58-7438-1b39dc0d6ef8@huawei.com> Date: Sat, 14 May 2022 11:39:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.176.73] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600009.china.huawei.com (7.193.23.164) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ?? 2022/05/13 21:13, Josef Bacik ะด??: > On Fri, May 13, 2022 at 02:56:18PM +1200, Matthew Ruffell wrote: >> Hi Josef, >> >> Just a friendly ping, I am more than happy to test a patch, if you send it >> inline in the email, since the pastebin you used expired after 1 day, and I >> couldn't access it. >> >> I came across and tested Yu Kuai's patches [1][2] which are for the same issue, >> and they indeed fix the hang. Thank you Yu. >> >> [1] nbd: don't clear 'NBD_CMD_INFLIGHT' flag if request is not completed >> https://lists.debian.org/nbd/2022/04/msg00212.html >> >> [2] nbd: fix io hung while disconnecting device >> https://lists.debian.org/nbd/2022/04/msg00207.html >> >> I am also happy to test any patches to fix the I/O errors. >> > > Sorry, you caught me on vacation before and I forgot to reply. Here's part one > of the patch I wanted you to try which fixes the io hung part. Thanks, > > Josef > > >>From 0a6123520380cb84de8ccefcccc5f112bce5efb6 Mon Sep 17 00:00:00 2001 > Message-Id: <0a6123520380cb84de8ccefcccc5f112bce5efb6.1652447517.git.josef@toxicpanda.com> > From: Josef Bacik > Date: Sat, 23 Apr 2022 23:51:23 -0400 > Subject: [PATCH] timeout thing > > --- > 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 526389351784..ab365c0e9c04 100644 > --- a/drivers/block/nbd.c > +++ b/drivers/block/nbd.c > @@ -1314,7 +1314,10 @@ static void nbd_config_put(struct nbd_device *nbd) > kfree(nbd->config); > nbd->config = NULL; > > - nbd->tag_set.timeout = 0; > + /* Reset our timeout to something sane. */ > + nbd->tag_set.timeout = 30 * HZ; > + blk_queue_rq_timeout(nbd->disk->queue, 30 * HZ); > + > nbd->disk->queue->limits.discard_granularity = 0; > nbd->disk->queue->limits.discard_alignment = 0; > blk_queue_max_discard_sectors(nbd->disk->queue, 0); > Hi, Josef This seems to try to fix the same problem that I described here: nbd: fix io hung while disconnecting device https://lists.debian.org/nbd/2022/04/msg00207.html There are still some io that are stuck, which means the devcie is probably still opened. Thus nbd_config_put() can't reach here. I'm afraid this patch can't fix the io hung. Matthew, can you try a test with this patch together with my patch below to comfirm my thought? nbd: don't clear 'NBD_CMD_INFLIGHT' flag if request is not completed https://lists.debian.org/nbd/2022/04/msg00212.html. Thanks, Kuai