Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2654003rwb; Mon, 19 Sep 2022 08:06:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Z4CzQ0uUhE67MMEJKRo5gQIfPYQVo/+sKRE3Ma8o6F+vDQMDxJjrh6+9iQiNGNVdo1pC2 X-Received: by 2002:a05:6402:440c:b0:43a:1124:e56a with SMTP id y12-20020a056402440c00b0043a1124e56amr16228189eda.134.1663599988485; Mon, 19 Sep 2022 08:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663599988; cv=none; d=google.com; s=arc-20160816; b=yG/7ASi6C3rDRFSD7+/61JCfmqTiLozURc+B5k0N5Ev+pQhusqWRNnsDEjH4+QcdY1 u3WZG0UuYdBnoGrUfKfRuUcmwCQ3173o+ec4fu7G+ga7XWEhoajTSbXIAZgjDona5fs/ Js9hzWlRM3/7zBKhAkPZVAcy1o8hMt5t4YBh+MaTjtyob+Peluxqs0mdu121M8NwKK7s N8QFRLUGReylRDmk7yGNlt6x53pX2h7R257hjEvQrB91JFs7WsRZvXQmRh5xh7cHn7Po GXli0O7jPawu1/TPdIn3RG813lIiKETElnb1GAdpwitBlIgMV4dgVmCKj10bdp2kTJpy eL5g== 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:feedback-id :dkim-signature:dkim-signature; bh=fywcV89B3993E+BZ10dDpiTceGh8dwxED9SuRuVsowc=; b=CwPWD5ww71UaeK/Fp2BrGAMAyKihROg1imrmuqEd2H4SK1JythKMYZC5Rx4iO3raz4 ENgaELlvdIqqzHlTSxVp/V4eapFXTg4fjZdkMCl5tZZ7EjuG8N9MNfJM+Zlnj5jXqfrt joEZbBqPMxD8c+OsVMWlRYBxZzTXjsqytqNfswykw05bc7m9qud3Y+kdqeeJKgf9LVNO vUF1kpfZsxOopWORahqYEUEOIs1qYm1Bf6jqiY/4PWMvUQ67YH2ab0mpXrvSFlHxhEoN SzJRHZSiQ9EDM79t+adRDRREODjsYwuBksS8LYZGPegAFEcxc2F8bvHmj04/MIPxgEWp BD8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tycho.pizza header.s=fm1 header.b=K2A98Oai; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=R5RMjHrv; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d39-20020a056402402700b00453b9f1f182si5763318eda.211.2022.09.19.08.05.59; Mon, 19 Sep 2022 08:06:28 -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=@tycho.pizza header.s=fm1 header.b=K2A98Oai; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=R5RMjHrv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbiISPEP (ORCPT + 99 others); Mon, 19 Sep 2022 11:04:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229810AbiISPDt (ORCPT ); Mon, 19 Sep 2022 11:03:49 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F1643337A for ; Mon, 19 Sep 2022 08:03:47 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 956BC5C03A8; Mon, 19 Sep 2022 11:03:45 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 19 Sep 2022 11:03:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tycho.pizza; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1663599825; x=1663686225; bh=fywcV89B39 93E+BZ10dDpiTceGh8dwxED9SuRuVsowc=; b=K2A98Oai+ww33ScM0/2e2A5Ggk Jwdvi3PPhQf4Bg512W5jT81hgNfr0IxRNYZ5TSrBSggrTl3prEQZ6dMU/Ijlp23c CgjIEClzA960//nLukC9/PPjBZx7jrd0bJHzGu+YGMWpm83QMqgwOEhmAKgv/oSm 6BBKH41IdINT1vmvHtENCOLLW6pQrTYW9zozGJDk6SNVtAfq+h3p3zIbR0jgGcvb u6Ri4FRNUSIpoeYP+aomflFg4YjepodsF2XlIslIZ5j4QToXCHcBgrFId6E+bv90 IKdtxPARdMBykz6n4xlufkz/SBoIEUEnONLaGOqxT7IEUSzZ0r7j8oCmHxlg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1663599825; x=1663686225; bh=fywcV89B3993E+BZ10dDpiTceGh8 dwxED9SuRuVsowc=; b=R5RMjHrvMGGGPbQpTX1Z0xN+DJED7wpUK1xy0miA5qB7 NfugZW8FQksdMoY+S2Kz+YZraGO+oQrZBZfQlZyRMyEuC0A4jmf5ndWBed6b86tI xTeDGzeK6qj92AzG3EYK4k9Xevcf9wR1Kn/GMDU5bhBawnqbdok944i2INbSs8Gb WtwejBI7PeoJ4Jm9/ixLurfgEEUvGpdIXQ0YPEQfUHHQV5eu+YmnFfnv4WJIRuZc ozWrsH5FE79+zJzq2SL/7hFm3tJ8kB2OSEc1Gx0Er8e8+goQbJ2damKeX14bO63O JiEzcBOoybanvLldqG859FhddvB1BX5BRbhB5uNP5g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedvjedgkeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepvfihtghh ohcutehnuggvrhhsvghnuceothihtghhohesthihtghhohdrphhiiiiirgeqnecuggftrf grthhtvghrnhepueettdetgfejfeffheffffekjeeuveeifeduleegjedutdefffetkeel hfelleetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epthihtghhohesthihtghhohdrphhiiiiirg X-ME-Proxy: Feedback-ID: i21f147d5:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 19 Sep 2022 11:03:43 -0400 (EDT) Date: Mon, 19 Sep 2022 09:03:41 -0600 From: Tycho Andersen To: Miklos Szeredi , Eric Biederman Cc: linux-kernel@vger.kernel.org, fuse-devel@lists.sourceforge.net, "Serge E. Hallyn" Subject: Re: [PATCH] fuse: In fuse_flush only wait if someone wants the return code Message-ID: References: <20220901140647.1125079-1-tycho@tycho.pizza> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220901140647.1125079-1-tycho@tycho.pizza> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 Miklos, On Thu, Sep 01, 2022 at 08:06:47AM -0600, Tycho Andersen wrote: > From: "Eric W. Biederman" > > In my very light testing this resolves a hang where a thread of the > fuse server was accessing the fuse filesystem (the fuse server is > serving up), when the fuse server is killed. > > The practical problem is that the fuse server file descriptor was > being closed after the file descriptor into the fuse filesystem so > that the fuse filesystem operations were being blocked for instead of > being aborted. Simply skipping the unnecessary wait resolves this > issue. > > This is just a proof of concept and someone should look to see if the > fuse max_background limit could cause a problem with this approach. > > Additionally testing PF_EXITING is a very crude way to tell if someone > wants the return code from the vfs flush operation. As such in the > long run it probably makes sense to get some direct vfs support for > knowing if flush needs to block until all of the flushing is complete > and a status/return code can be returned. > > Unless I have missed something this is a generic optimization that can > apply to many network filesystems. > > Al, vfs folks? (igrab/iput sorted so as not to be distractions). > > Perhaps a .flush_async method without a return code and a > filp_close_async function without a return code to take advantage of > this in the general sense. > > Waiting potentially indefinitely for user space in do_exit seems like a > bad idea. Especially when all that the wait is for is to get a return > code that will never be examined. > > Signed-off-by: "Eric W. Biederman" > [tycho: small fixups for releasing fuse file + nocred flag] > Signed-off-by: Tycho Andersen > Reported-by: Tycho Andersen > Tested-by: "Serge E. Hallyn" Any chance you're willing to take this patch? We're still seeing this a lot and it would be great to get it fixed. Thanks. Tycho