diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2025-03-06 18:28:56 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2025-06-16 15:07:34 -0400 |
| commit | 61c5d53e815784708c45dac086c50a12ed1db694 (patch) | |
| tree | 5404edfaec465d5b9390f1ac620ae40a55ad9b23 /fs/libfs.c | |
| parent | 19272b37aa4f83ca52bdf9c16d5d81bdd1354494 (diff) | |
simple_recursive_removal(): saner interaction with fsnotify
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.
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/libfs.c')
| -rw-r--r-- | fs/libfs.c | 5 |
1 files changed, 1 insertions, 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) { |
