Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp997830iob; Fri, 13 May 2022 19:05:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM1rSGhj2efvB6As+qz5Xr8cR7oDIxSypVw3EFcZFTg67LrcbVZCYay0CyvKCKG/coHoJt X-Received: by 2002:a05:600c:1d95:b0:394:5d0d:6f70 with SMTP id p21-20020a05600c1d9500b003945d0d6f70mr6889539wms.48.1652493917410; Fri, 13 May 2022 19:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652493917; cv=none; d=google.com; s=arc-20160816; b=StYlFatbaXRjvQeU9Jt7WvpcRIvs36uiBS8/GmI2zcojcWfbBJBPXGL4nF5/l4Yq7k fib+4CLZZj36uSu5c+bEWh5DUxs351XVcFJHopB+KCMMGpzfB+1v94ZTJc85/uRDX9ev +Ikpk6H00CLxF8+sc+fMmyACVIPcuv5w9+n3buYH1pUodPWEqZztaFOShqWmqPfzQ6Ev qnYun4UES5ZTsrHjLzg9UzULKaBe+7Eu/+3X7Gl6C++CQ6KtwytzLai7L0a4rogqRHit vqRh7XLGSqyxKcw9bheALe2KpIC/91eLahv5aTdGwhwoZpArMzhGNk0hk/+LumqGapBl 6LgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6+gNOUaWkd0Bt/JIZ8SDZDMjw5UUXZsqOvLbfnJqY8g=; b=fiS44SRisT8zb6z4Pl831a3ckm1m7cw560gAOOFgJIsf3yYkGRTS29VeSl/9Zcwkhl OKDYZ2j3uabE3MsiyqKOU/ZouDy0EVtfuZcPT0DtecD28VC8DfNzxyp1O9LNEg5rnFyP n12Jp4hI2z4+wGYU1UEgITv26a9W56ZqoJCheOV0x1o8OTmvkl0/PTomIPUGEjj1nkGG c+bXTvAee6P1+xbTtxiBioi5wW5laU0mmw6Yx5h/n0dczlESBjSLoslKYCEWXZ5QKAty iLQSsXL0gmzma29chHV7nXl+hzDKuzRf6rcSiSr0eZHL+Xpm0q/zKxg/q9Tfsh5YfrIm z95Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toxicpanda-com.20210112.gappssmtp.com header.s=20210112 header.b=XQFCZfhm; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n7-20020adffe07000000b0020af06a718fsi3262865wrr.454.2022.05.13.19.05.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:05:17 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@toxicpanda-com.20210112.gappssmtp.com header.s=20210112 header.b=XQFCZfhm; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D5F95ED7A9; Fri, 13 May 2022 17:26:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380597AbiEMNNq (ORCPT + 99 others); Fri, 13 May 2022 09:13:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232625AbiEMNNl (ORCPT ); Fri, 13 May 2022 09:13:41 -0400 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46E0750B1F for ; Fri, 13 May 2022 06:13:38 -0700 (PDT) Received: by mail-qt1-x831.google.com with SMTP id fu47so6753417qtb.5 for ; Fri, 13 May 2022 06:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=6+gNOUaWkd0Bt/JIZ8SDZDMjw5UUXZsqOvLbfnJqY8g=; b=XQFCZfhm7ewTc4XGGTXLDs4ORqJoIOmN58pp/aiyNiZn+4KQD1n6GurSxpZnIeHGle BHgljDzcb8IocKVAna6UfJsdoy3zR4xntjetc9xE+ggJfXqHnFMAtZZ2uXcUAwnJpXM4 z71gIN4Kf3+6Mn/A63t1Hqxn3h5n4ioP20D9p71dlE7v5cFGM4zcQkOi7DROx9Wfe2AN L9qYy/9ImbchcWiAdMnPMP1D3jFrgOf98pEoGnR7dsYj8g90ZIRsjjl42tE0GcZLl37n db9DftV4Q3/mGZbH/epzsq/QZAHrmL6njW81VxjaZZ2AakSkhIjFmysB8xqF/PjD1wvi bqOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6+gNOUaWkd0Bt/JIZ8SDZDMjw5UUXZsqOvLbfnJqY8g=; b=J46UvqMLx12Vrn204q7P9BeU1eiwrNXhu1ipJDZOZxUyBtGsYZcN021hMsYjyci6O/ xIFQrjUyNcilyXzGIJ6WAkCPrp4C8Ib3D5+amcMFeywJSoslqeILzywZn2M9Lzr3X4nD VxSBbZv9VTmMWHTcUN32fhVuc1xpyeOBzvPEf2qR+DCWGPX6Isbzjsu+TXfiUzeGs3bn sDzjJfxOhuGxTScbQOgg6N9suGjFJUtLwmY+qz9urgh6orBt7aszpBPyvj/cq9B9LKuf Ef3kmjIp5dRpsorqhZ2LosOs2kvyPUedTcD/UInz10vvsZYri6sou3ulW3mmh02clELp z3XQ== X-Gm-Message-State: AOAM5312KC4wLX1RPpOAcwENI3QJPR/2JjM6QjEgJJHYEhqxLsr1OGZI tYlH4P6vki0Fq3VeiWos1zxbsw== X-Received: by 2002:ac8:7f0d:0:b0:2f3:cd9e:c2ea with SMTP id f13-20020ac87f0d000000b002f3cd9ec2eamr4447513qtk.590.1652447617290; Fri, 13 May 2022 06:13:37 -0700 (PDT) Received: from localhost (cpe-174-109-172-136.nc.res.rr.com. [174.109.172.136]) by smtp.gmail.com with ESMTPSA id q19-20020ac87353000000b002f39b99f67esm1445845qtp.24.2022.05.13.06.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 06:13:36 -0700 (PDT) Date: Fri, 13 May 2022 09:13:35 -0400 From: Josef Bacik To: Matthew Ruffell Cc: Jens Axboe , linux-block , nbd , Linux Kernel , yukuai3@huawei.com Subject: Re: [PROBLEM] nbd requests become stuck when devices watched by inotify emit udev uevent changes Message-ID: References: <20220422054224.19527-1-matthew.ruffell@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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); -- 2.26.3