Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4273302rwb; Tue, 20 Sep 2022 11:14:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6P+PP1YpRaGgJDEIuT/LnxOPE7b7sgAUznQXMwnqbmTfDgyCqq0TOPyPcaIPtN2OME/fcL X-Received: by 2002:a05:6a00:114f:b0:528:2c7a:634c with SMTP id b15-20020a056a00114f00b005282c7a634cmr25041492pfm.41.1663697683674; Tue, 20 Sep 2022 11:14:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663697682; cv=none; d=google.com; s=arc-20160816; b=uKGyoDv9EALE2Ia1GF4yxtryPjPOoUctxoU0sE02KeTAbWoY5tDLi7FA/qX1gnY1NO XbZy7zOou1WgzmWwFmP7dDm3vu+VOEJLdY6IDCAw7v3QiBU4hjYQmHsjdVT9i2A5rUVL zCmewt57ogfooBvANQ2pVrfFYcgQDlsMUi5GczcTBcEutUGuS3R3qkwhYYHqct7EQM2p d8MDGJ8+uRbjydaaR6ldg85YSTrk6p1qpgAfqxoFhY6H/nsAEX6lFEWTf3xlQZ4zWZ7q hxIHT6EzVY4UHB0Lq2atK9fwxeF64mwnzVEmX2fJA/v4F2zooTNpw8Gi42bi43H/fbeM AixA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=9r3eANYn4jDqQP37pt8DnfFVfdqOA3pe+NzY3JjhiQw=; b=LdAtV+drFvJB9kjTZ13S76vulNU8DAeaAA8MJEczstPTZ6s0z7n1J6DChU06sKFN9I sJe+HTs1ANYgcAQ4FFuTzHLFsIm7x/5wto8WAH9OFb5Q/fXbw8gp/x+vgsxY1Y0tZS3W p70dB/UCyoyN61V5YrgK1cWXjPFbXflnFtAsHb9bBzTNf+KdOdBRDSEFHxSG8R3LV4so gdMbL5004hnvwwAO25x1sHDfkuRME3SKyTZWFDmsstJHoWgURoDYaMCcMt2zjP/3iFEM g708Uf4EfzPybGogv7M8aiwryZ3QKmXVxhnnSyNuyb40TOayEXPZ52qv87+f6TME7Xly hM1A== 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: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 x17-20020a170902ec9100b00177e335976bsi511197plg.254.2022.09.20.11.14.14; Tue, 20 Sep 2022 11:14:42 -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; 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 S230409AbiITSCg (ORCPT + 99 others); Tue, 20 Sep 2022 14:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230456AbiITSCe (ORCPT ); Tue, 20 Sep 2022 14:02:34 -0400 Received: from mail.hallyn.com (mail.hallyn.com [178.63.66.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D92925F215 for ; Tue, 20 Sep 2022 11:02:32 -0700 (PDT) Received: by mail.hallyn.com (Postfix, from userid 1001) id 4A08697B; Tue, 20 Sep 2022 13:02:31 -0500 (CDT) Date: Tue, 20 Sep 2022 13:02:31 -0500 From: "Serge E. Hallyn" To: Tycho Andersen Cc: Miklos Szeredi , Eric Biederman , 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: <20220920180231.GA31753@mail.hallyn.com> References: <20220901140647.1125079-1-tycho@tycho.pizza> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 On Mon, Sep 19, 2022 at 09:03:41AM -0600, Tycho Andersen wrote: > 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. I tried to track this down last week, but it looks to me like since the max_background is per-connection, this should work as expected and not affect any other connections. > > 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