linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, chuck.lever@oracle.com,
	jlayton@kernel.org,  linux-nfs@vger.kernel.org, neil@brown.name,
	torvalds@linux-foundation.org,  trondmy@kernel.org
Subject: Re: [PATCH 01/17] simple_recursive_removal(): saner interaction with fsnotify
Date: Fri, 13 Jun 2025 10:19:25 +0200	[thread overview]
Message-ID: <CAOQ4uxhW3Hvicbb7Byi3_UbvBuS3-fpBOC8gmQ7d+Cns1wbWJg@mail.gmail.com> (raw)
In-Reply-To: <20250613073432.1871345-1-viro@zeniv.linux.org.uk>

On Fri, Jun 13, 2025 at 9:35 AM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> Make it match the real unlink(2)/rmdir(2) - notify *after* the
> operation.  And use fsnotify_delete() instead of messing with
> fsnotify_unlink()/fsnotify_rmdir().
>
> Currently the only caller that cares is the one in debugfs, and
> there the order matching the normal syscalls makes more sense;
> it'll get more serious for users introduced later in the series.
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Makes sense.
Reviewed-by: Amir Goldstein <amir73il@gmail.com>

> ---
>  fs/libfs.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/fs/libfs.c b/fs/libfs.c
> index 9ea0ecc325a8..42e226af6095 100644
> --- a/fs/libfs.c
> +++ b/fs/libfs.c
> @@ -628,12 +628,9 @@ void simple_recursive_removal(struct dentry *dentry,
>                         inode_lock(inode);
>                         if (simple_positive(victim)) {
>                                 d_invalidate(victim);   // avoid lost mounts
> -                               if (d_is_dir(victim))
> -                                       fsnotify_rmdir(inode, victim);
> -                               else
> -                                       fsnotify_unlink(inode, victim);
>                                 if (callback)
>                                         callback(victim);
> +                               fsnotify_delete(inode, d_inode(victim), victim);
>                                 dput(victim);           // unpin it
>                         }
>                         if (victim == dentry) {
> --
> 2.39.5
>
>

  parent reply	other threads:[~2025-06-13  8:19 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13  7:31 [PATCHES][RFC][CFT] rpc_pipefs cleanups Al Viro
2025-06-13  7:34 ` [PATCH 01/17] simple_recursive_removal(): saner interaction with fsnotify Al Viro
2025-06-13  7:34   ` [PATCH 02/17] new helper: simple_start_creating() Al Viro
2025-06-13 18:31     ` Jeff Layton
2025-06-13 22:36       ` Al Viro
2025-06-13 23:46         ` Jeff Layton
2025-06-13  7:34   ` [PATCH 03/17] rpc_pipe: clean failure exits in fill_super Al Viro
2025-06-13  7:34   ` [PATCH 04/17] rpc_{rmdir_,}depopulate(): use simple_recursive_removal() instead Al Viro
2025-06-13  7:34   ` [PATCH 05/17] rpc_unlink(): use simple_recursive_removal() Al Viro
2025-06-13  7:34   ` [PATCH 06/17] rpc_populate(): lift cleanup into callers Al Viro
2025-06-13  7:34   ` [PATCH 07/17] rpc_unlink(): saner calling conventions Al Viro
2025-06-13  7:34   ` [PATCH 08/17] rpc_mkpipe_dentry(): " Al Viro
2025-06-13  7:34   ` [PATCH 09/17] rpc_pipe: don't overdo directory locking Al Viro
2025-06-13  7:34   ` [PATCH 10/17] rpc_pipe: saner primitive for creating subdirectories Al Viro
2025-06-13  7:34   ` [PATCH 11/17] rpc_pipe: saner primitive for creating regular files Al Viro
2025-06-13  7:34   ` [PATCH 12/17] rpc_mkpipe_dentry(): switch to start_creating() Al Viro
2025-06-13 19:27     ` Jeff Layton
2025-06-16 19:26       ` Al Viro
2025-06-13  7:34   ` [PATCH 13/17] rpc_gssd_dummy_populate(): don't bother with rpc_populate() Al Viro
2025-06-13  7:34   ` [PATCH 14/17] rpc_pipe: expand the calls of rpc_mkdir_populate() Al Viro
2025-06-13  7:34   ` [PATCH 15/17] rpc_new_dir(): the last argument is always NULL Al Viro
2025-06-13  7:34   ` [PATCH 16/17] rpc_create_client_dir(): don't bother with rpc_populate() Al Viro
2025-06-13  7:34   ` [PATCH 17/17] rpc_create_client_dir(): return 0 or -E Al Viro
2025-06-13  8:19   ` Amir Goldstein [this message]
2025-06-13 19:32 ` [PATCHES][RFC][CFT] rpc_pipefs cleanups Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOQ4uxhW3Hvicbb7Byi3_UbvBuS3-fpBOC8gmQ7d+Cns1wbWJg@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=torvalds@linux-foundation.org \
    --cc=trondmy@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).