Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp974428rdb; Tue, 15 Aug 2023 19:21:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFn/1dX9MOkc5mHnTzwbLwTzuxR1/1hoOmTykY20nqUKll4yf8X0/xvOFyHxvzbbhDXMrq8 X-Received: by 2002:a05:6358:248b:b0:13a:1e90:4813 with SMTP id m11-20020a056358248b00b0013a1e904813mr1075919rwc.29.1692152491098; Tue, 15 Aug 2023 19:21:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692152491; cv=none; d=google.com; s=arc-20160816; b=UnkQhkZBCBurDKsz5ls6ygMery2IjT0HgqgFXREHjyrg/DXbjcAygeBYAzoAVSWIA8 jNW3gxtz3CEn2LEMQpcOGoTHpDUAgmB6GVbJVXl2TZlcQc7RW6i8p93DtNyHosSkaTG9 n8tYE4aHnFY7aws7VNxymsOgDX6RvUd0reM3QakpGvVL7/4Q/aupDN/oMi1V6Eti/XQJ B3+DUooGXeVbPq2f4CL83wgKIKShul77wvLstDdgCcFUW+cchvMMM0BNYP/c3cZdc9Gr dVarosUhsmayorZa7dwgL4NxW1dPh+gFl+3Xti5XbdTfxddNw4QMA/0xSVS8cr0urdTz qqOw== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:feedback-id:dkim-signature:dkim-signature; bh=eEPse9ECRAzn6ElLDhuMktRPeYOzvASO0sc0DZKvmYU=; fh=ohp9hF8jC33lypuxgi/N+EUrxUfevS0HHzMSwfA1DzM=; b=v6Mq3okzcPtBOsTuFkvutNO5NUM+9RkTzOME8g5iCd6ii3g4VpIpPn/yoCwIuPRCrl E4ZWcG021sUQDafPGLnRitHFBLTNdfAe8dUEFKcDqN/Cooz/s8Seuu5FJmYxsPF4zy+T 6Gmh7is3gQOgK97EyyBgV31yMGou5+EOJdsV0j2T5TC/o1n1eZaQH45Ecx1t2i7bp3eu g83FbQFvbsS9oGUOz49EYKoBBfzFyGxrYOzB2kitBGHikc3YUGRwoA83UouPTEvRFi39 aCVfvgh7a3gO1RHYZ2zD9plN1QMB4C+/eAGOFzy6khYkD0Z59GGORsH1U1E4roK8vaOq HMNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (expired) header.i=@fastmail.fm header.s=fm1 header.b="TnYi/bbs"; dkim=neutral (expired) header.i=@messagingengine.com header.s=fm1 header.b=Yrr2YQxa; 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=fail (p=NONE sp=NONE dis=NONE) header.from=fastmail.fm Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bx13-20020a056a02050d00b00563f02cd60esi11408239pgb.150.2023.08.15.19.21.19; Tue, 15 Aug 2023 19:21:31 -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=neutral (expired) header.i=@fastmail.fm header.s=fm1 header.b="TnYi/bbs"; dkim=neutral (expired) header.i=@messagingengine.com header.s=fm1 header.b=Yrr2YQxa; 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=fail (p=NONE sp=NONE dis=NONE) header.from=fastmail.fm Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232982AbjHNVen (ORCPT + 99 others); Mon, 14 Aug 2023 17:34:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231576AbjHNVeO (ORCPT ); Mon, 14 Aug 2023 17:34:14 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A95611D; Mon, 14 Aug 2023 14:34:13 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 59ED73200657; Mon, 14 Aug 2023 17:34:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 14 Aug 2023 17:34:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-transfer-encoding:content-type: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= 1692048851; x=1692135251; bh=eEPse9ECRAzn6ElLDhuMktRPeYOzvASO0sc 0DZKvmYU=; b=TnYi/bbsx2ggn2SGxWnJEQmGzN3OagYR6pyoisWagh4c0+k/yoe CFMS2wcVDMoEgemvomHr7DyYNS+RyjzwJKvi7XM+Wq0dSjmLYj0Q/xwSV7Fe27z1 WXvInKfrtv1HGmaMsVdzncWRpbVWezt5n59obXQ63qNYplMEJEzZlSVPXHPop+9/ xFS4EtMfxJMQjk0JpT1UFs28ae2dfbzEYL2YgIyfYN8apX/8oGKYSOVoPew0vsBw lgmK5ikayUFfl3vX0udYtTpGwJkPFtpgOMBb1yOXNXNUIfmLgpS25y7xWIfWKddN TB2FZ39wRIVw8oSiGnF2ih8SVyStbfUeAgA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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=fm1; t= 1692048851; x=1692135251; bh=eEPse9ECRAzn6ElLDhuMktRPeYOzvASO0sc 0DZKvmYU=; b=Yrr2YQxaq9qY7kvHoBRQQZisXd01NX5Huwafc/YT4iQRIBuim9G dn0qwX5uHi/4gRrL25XkaJjxLCvEhM1x39HkrmfOW5O854cuYUY9qaW8K0qcN1th INo4sBBF6bQjfYxykDpa4mS9znLFdkV5hE/e4db9wk8BcLxGl6Z2hE9weBISdz63 HBnV9r4zdMT42Nrwull50uhFLElIICkvItjOZHB7lyEORooEQ9u7vSrf+M+hXFfN QWpy+daS7YjgtTtQ3q1uwLGuv7S3xTd88O9Q9tBRsG1wwn3XG9M/X5K8BVnPUZtR FksX1XEVR8dywg+lG3/kY6hUrBKE9X46Q4Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddthedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeeuvghr nhguucfutghhuhgsvghrthcuoegsvghrnhgurdhstghhuhgsvghrthesfhgrshhtmhgrih hlrdhfmheqnecuggftrfgrthhtvghrnhepfffhtddvveeivdduuedujeetffekkeelgfdv fefgueffieefjefgjeffhedttdefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsggvrhhnugdrshgthhhusggvrhhtsehfrghsthhmrghilhdr fhhm X-ME-Proxy: Feedback-ID: id8a24192:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 14 Aug 2023 17:34:10 -0400 (EDT) Message-ID: Date: Mon, 14 Aug 2023 23:34:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [REGRESSION] fuse: execve() fails with ETXTBSY due to async fuse_flush Content-Language: en-US, de-DE To: Tycho Andersen , Miklos Szeredi Cc: =?UTF-8?Q?J=c3=bcrg_Billeter?= , "Eric W. Biederman" , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, regressions@lists.linux.dev References: <4f66cded234462964899f2a661750d6798a57ec0.camel@bitron.ch> From: Bernd Schubert In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,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 On 8/14/23 16:00, Tycho Andersen wrote: > On Mon, Aug 14, 2023 at 01:02:35PM +0200, Miklos Szeredi wrote: >> On Mon, 14 Aug 2023 at 08:03, Jürg Billeter wrote: >>> >>> Since v6.3-rc1 commit 5a8bee63b1 ("fuse: in fuse_flush only wait if >>> someone wants the return code") `fput()` is called asynchronously if a >>> file is closed as part of a process exiting, i.e., if there was no >>> explicit `close()` before exit. >>> >>> If the file was open for writing, also `put_write_access()` is called >>> asynchronously as part of the async `fput()`. >>> >>> If that newly written file is an executable, attempting to `execve()` >>> the new file can fail with `ETXTBSY` if it's called after the writer >>> process exited but before the async `fput()` has run. >> >> Thanks for the report. >> >> At this point, I think it would be best to revert the original patch, >> since only v6.4 has it. > > I agree. > >> The original fix was already a workaround, and I don't see a clear >> path forward in this direction. We need to see if there's better >> direction. >> >> Ideas? > > It seems like we really do need to wait here. I guess that means we > need some kind of exit-proof wait? I'm not sure how hackish it is, if fuse_flush gets converted to queue_work() and with a new work-queue in struct fuse_inode. That work_queue could be flushed through a new inode operation from do_open_execat. Bernd