From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.205.69.214 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793617056; b=VmoFJuZ6lyujhAUuMqqBUzV6/zLn5WlrjAh/iIFaNQOmKN4uJwASiqA05JkSBaaZ92JZ Uh7FSh6TWzhh9AL17GI9ZlMFjMwV4ROukWUHo7bUN5CYS9ZTYmKe1pl6e87NrqVVcdyD8 MIurfGdEytLcQ2MOmUnVzZwx0bIPiWg49Atwmoiq+TG9kQ7vgll0nkWFXFsskJk66aofs cgxrO2nxgQHQvZ0uFY8jVMPjViImfIGKk89ectRmDk2okWK7o2pLae04IBQGQgRwyZQKC bBLbARGJgV7qVVWEQ2zlw0UUIewRV3QTOT9Yj//IgQfkfrTX2TzaoyyU3j82L60mz6Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793617056; h=DMARC-Filter:Received:DKIM-Signature:Date:From:To:Cc:Message-ID: In-Reply-To:References:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Feedback-ID; bh=j+hZkYzIVJ9tilITm55Z46aHn+yx/FRnXY+i3pCcfjU=; b=GuLKboitSJGWgOfEld1jdDyVMNtcU3p+FFpTnrn8BHNojzDchbvvzs3Mhq1DmPExDk1T Oi50ZcIrwPEZEbx2m4NxGE2ldsMbt1O6SnUw/BtBhcEKyOkMdNxHwth+CbWqwaZK3tieD Z+KUrC5RKUq720GCBrMnecQMWsUhPnk+JlGKpy8KwRXyxDuIZjTD5DN7WwSEL+gEj1JD/ uC4EU2TvYPLhE9i54P3o7pGI66SoHgoGT6VhkHAaDMGTPFX7hvoVjBnshhLFn1YXonrQq XwzE7GFLkpTFEcnIjLmOhBH/0yMOWJMuEkA9grz/Shfy+Fkta2y3PsyQVXoKYqyiv3w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=tuta.io; spf=pass smtp.mailfrom=tuta.io; dkim=pass header.d=tuta.io header.i=@tuta.io header.a=rsa-sha256 header.s=s1 header.b=QC1Zl+zA; arc=none smtp.remote-ip=185.205.69.214 Received: from mail.w14.tutanota.de (mail.w14.tutanota.de [185.205.69.214]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 264AA60A2630 for ; Mon, 2 Nov 2026 10:57:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 264AA60A2630 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuta.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuta.io Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=tuta.io header.i=@tuta.io header.a=rsa-sha256 header.s=s1 header.b=QC1Zl+zA Received: from tutadb.w10.tutanota.de (w10.api.tuta.com [IPv6:fd:ac::d:10]) by mail.w14.tutanota.de (Postfix) with ESMTP id 8DCEE1A0E92E3 for ; Mon, 2 Nov 2026 11:57:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1793617054; s=s1; d=tuta.io; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=j+hZkYzIVJ9tilITm55Z46aHn+yx/FRnXY+i3pCcfjU=; b=QC1Zl+zAvweFYUJsfIXB+oARRLdGvi5cYOF28k6+f0iavdSy26br8e8t8Dv7vBML 7wxYLNwx3lj0kKYwKnuAPGpguvRnFXvSK4QmooUoukAjWHgOa9WvqZ8yXeN6AqSAeB6 uQj9nWMbBbr1rgiGv+D6P1YWtFxYapyqSLaaJgpW0K8epeN+xEWKMX/Ixlpp/zAQA0u blNy3ccAhErFiwKOWY5aDZeMNWaAlyeY9hPprt+NYSpOtbkBqVc9IcS/wMkMvYpXO2a L/kJQMl4LLu7hBvruSopBmlTcL71I5tDTL3aF9OqCZeOAThTlRuI1dVKt6umCwzvWxp /FpchbbJZw== Date: Mon, 2 Nov 2026 11:57:34 +0100 (CET) From: Edvard Conrad To: Amir Goldstein , Christian Brauner Cc: Miklos Szeredi , Alexander Viro , Jan Kara , "linux-fsdevel@vger.kernel.org" , "linux-unionfs@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Edvard Conrad Message-ID: In-Reply-To: References: <20261030-welpen-anbinden-nullen-b2432cee1d10@brauner> Subject: Re: [PATCH v3] fs: let backing files inherit FMODE_NONOTIFY from the user file X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Feedback-ID: 0127f977f5e13e8051b46c6e7f57d0f95a0470d24b79d7c31d07fdf611cc427ab823e0f4692a810119c92d8768973a9281:TurnOnPrivacy!:tutamail On Fri, Oct 30, 2026 at 6:13 PM Amir Goldstein wrote: > Would you mind adding test cases (or variants) to fanotify26 to cover > this find and test the attached (sanity tested only) patch. Two things on the directory side, one settled and one not. Agreed on 130fdbc3d1f99 ("ovl: pass correct flags for opening real directory"). Before it ovl_dir_open() passed the user file's f_flags to ovl_path_open(), and __FMODE_NONOTIFY travelled with them; the commit reasons through every O_* flag but that one is not an O_* flag. That fits v6.13 failing the directory case and passing the file case. The one that is not settled: with your patch, listing a merged directory through the event fd still deadlocks. ovl_iterate() sends a directory that has OVL_WHITEOUTS to ovl_iterate_merged(), and ovl_dir_read() opens each layer with plain ovl_path_open(), which no user file reaches. A listener that calls getdents64() on the fd before answering blocks here: fanotify_handle_event fsnotify fsnotify_open_perm_and_set_mode do_dentry_open vfs_open dentry_open ovl_dir_read_merged ovl_iterate iterate_dir __x64_sys_getdents64 Two controls on the same kernel: the same merged directory without the listing passes, and a lower-only directory with the listing passes, since od->realfile is nonotify with your patch and iterate_dir() uses it directly. That was on 6b4b543fa18 with your patch applied (with some fuzz); the readdir.c paths involved are the same in today's master. I have it as an extra case in a local copy of fanotify26 and can post it once there is a fix to run it against. Incidentally, I was thinking about your ask for something more generic: a task-level "creating an event fd" state in fanotify would cover the file and directory opens in one place, and the copy-up opens in copy_up.c too, which also go through plain ovl_path_open() and which an O_RDWR group would trigger for a lower-only file (from reading, not tested). It would not reach the listing case above, which runs at getdents() time, long after the fd exists. Thanks, Edvard