Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3306513ioa; Tue, 26 Apr 2022 00:32:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9r7CiW5uWET2pXGrTl/hQwHJiw6JZQ3oge0HvjGt0h4scGJRwTmq1CThLXjOTTYs8XxqD X-Received: by 2002:a05:6a00:2187:b0:50c:ef4d:ef3b with SMTP id h7-20020a056a00218700b0050cef4def3bmr20348536pfi.83.1650958377025; Tue, 26 Apr 2022 00:32:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650958377; cv=none; d=google.com; s=arc-20160816; b=yWMFB0KX76k4uP8UfQg7qUCeBQBKVdO0enJQOS92UcND4/Se1rUTOoRSJmGmrYeXQp atO8326AYxG8xHKimVd9JrAQyjb/tdGM7xKGF+aSVpnwvO6lCDrExWnapws+oEBPqHoT fquyysEviqO6TbHW1QjDOVRz+ijqnPAuMBMLomm80mDJRpp7yachh1d5Y2/pC3w2X7QL HWaz3fAg08BykuaF0fNDskv71m1HzjsRvpCGNgLjfY1cyE4sLe5e/STRxIWVKcSfHFfc Ruo3ZIipYPv+a2IMP/Bnj42XP2pDz8/vBDdJMYelnoaySzFgt/BvEkgC9pLR7OWJtyqm Hy2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UO4wzxZajFtH3qcfy3dLF1bQAk44v43NDT+rmdRn5Yo=; b=d0JTn41bEMb/PBp9BMBhYj1AClmvYhMc88RbqdqNZs8htHdT1PY9Drjksyn2F2pZfs X86Weu2A6tHqNYy1LZ5S6lRhd8DKVg/eiE8BsfbA4a6t+yPmIpBjId8MFH5ExiyImt80 PvTHz+zmzHerDe8nX+SvES/cc/N7TRgUTGwEwjaGXsxMuUfpy7FN/67gB+1sZ2AsrufF oIPt/EKe9p5kHa/taPwJImuz2WtBsMvKOsMhqJrPgRjx011bowJ+KhpINKfE2gJwKxNt pKNsO7unx+PO8nqSm0Z7nn8TuZCCU81jejk+3XQEY7vbTFKr8kXq6JIlhVWSmuLz304v gLEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=J5+97Ol7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k22-20020a170902ba9600b0015ad8a424e3si13882981pls.428.2022.04.26.00.32.43; Tue, 26 Apr 2022 00:32:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=J5+97Ol7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237820AbiDYWZK (ORCPT + 99 others); Mon, 25 Apr 2022 18:25:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343626AbiDYVul (ORCPT ); Mon, 25 Apr 2022 17:50:41 -0400 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E08C83AA52 for ; Mon, 25 Apr 2022 14:47:35 -0700 (PDT) Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 6E9253F6F0 for ; Mon, 25 Apr 2022 21:47:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1650923253; bh=UO4wzxZajFtH3qcfy3dLF1bQAk44v43NDT+rmdRn5Yo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=J5+97Ol7GprYEW2ZEzNG4XzYVNsOUW0hZWdsQzVB/duFtm7QztNyWaCuwFifRdVLS UK1L5wsfM9Ng4KwhlUOM6ddLDISodBfm93unZoI892dJsJUI9OK76qgKASLecXZrIl 5xct1CynTk3pCa0/saQfmfmTeEuPUvvFJ39omJCB6zUfdh317D7D8oJL8sg2+gTRu5 zvxU6CqFHPfTPxzVPL7Yr8qVvVYIjp27l5LhfKkcRFx92VoQAZoiGANueJM+j7uut6 Z01+xXCiWe/4/Eu4Z42UtYTMKKty4G3LW01MvFO8wM3jPXKC2pKF4sYWBi/9RfCYM+ 4vhJAozziJTUg== Received: by mail-pg1-f199.google.com with SMTP id c32-20020a631c60000000b0039cec64e9f1so9892384pgm.3 for ; Mon, 25 Apr 2022 14:47:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UO4wzxZajFtH3qcfy3dLF1bQAk44v43NDT+rmdRn5Yo=; b=ar62+iui4vkRrxXZcTKvEGCTvu1y+sW5aYlWXNswJTj51uWw9HaY/vutfgwyaoZRhd luVeqNeZtRqmvld7XmAbNxeXKMPN344SejsGhF7Aut+08tOg+/ol36B08Si4KkX8BULC wSHX9S55C473e4rP89/9+eWc8FQki1Jyo0rFjyK0tlIBvNdwl3lmltlm1pI6ovDtDqxi +vmwJnYJQV34o63UpZhBqRuxQkAtN9iL1fyX6hpqsjAN2DPNnas29FiO5P8TBzOJhiPg JgZ9fvr+e3abdCFoyWHktQFeb7D6/8g9NRwvkHBsoLU3S3GBkHapNrbUnQ+KiUauvJX+ KlBA== X-Gm-Message-State: AOAM532eLePYX2wQu6ceZqRRAEOHlMDfW1OF+/pwWyMv5K4KNqrZ7tbo nf5mt2bCH3YLHy5WeIp1aHgag6uVThJf9Lg0nsM/Cibg3DjOQSOULzy2cNJRAvdCQ8x/ROoikrS qugaGf4jk1IQE0Rl2tsE5BUOkpdt3rMa1vBiz1J/KxXuYAYigUo3s8cxbmA== X-Received: by 2002:a17:90b:886:b0:1d9:3a05:3f2a with SMTP id bj6-20020a17090b088600b001d93a053f2amr14051818pjb.53.1650923251837; Mon, 25 Apr 2022 14:47:31 -0700 (PDT) X-Received: by 2002:a17:90b:886:b0:1d9:3a05:3f2a with SMTP id bj6-20020a17090b088600b001d93a053f2amr14051798pjb.53.1650923251590; Mon, 25 Apr 2022 14:47:31 -0700 (PDT) MIME-Version: 1.0 References: <20220422054224.19527-1-matthew.ruffell@canonical.com> In-Reply-To: From: Matthew Ruffell Date: Tue, 26 Apr 2022 09:47:20 +1200 Message-ID: Subject: Re: [PROBLEM] nbd requests become stuck when devices watched by inotify emit udev uevent changes To: Josef Bacik Cc: Jens Axboe , linux-block , nbd , Linux Kernel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 Hi Josef, The pastebin has expired the link, and I can't access your patch. Seems to default to 1 day deletion. Could you please create a new paste or send the patch inline in this email thread? I am more than happy to try the patch out. Thank you for your analysis. Matthew On Sat, Apr 23, 2022 at 3:24 AM Josef Bacik wrote: > > On Fri, Apr 22, 2022 at 1:42 AM Matthew Ruffell > wrote: > > > > Dear maintainers of the nbd subsystem, > > > > A user has come across an issue which causes the nbd module to hang after a > > disconnect where a write has been made to a qemu qcow image file, with qemu-nbd > > being the server. > > > > Ok there's two problems here, but I want to make sure I have the right > fix for the hang first. Can you apply this patch > > https://paste.centos.org/view/b1a2d01a > > and make sure the hang goes away? Once that part is fixed I'll fix > the IO errors, this is just us racing with systemd while we teardown > the device and then we're triggering a partition read while the device > is going down and it's complaining loudly. Before we would > set_capacity to 0 whenever we disconnected, but that causes problems > with file systems that may still have the device open. However now we > only do this if the server does the CLEAR_SOCK ioctl, which clearly > can race with systemd poking the device, so I need to make it > set_capacity(0) when the last opener closes the device to prevent this > style of race. > > Let me know if that patch fixes the hang, and then I'll work up > something for the capacity problem. Thanks, > > Josef