Skip to content

Commit 61c5d53

Browse files
author
Al Viro
committed
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>
1 parent 19272b3 commit 61c5d53

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

fs/libfs.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,12 +628,9 @@ void simple_recursive_removal(struct dentry *dentry,
628628
inode_lock(inode);
629629
if (simple_positive(victim)) {
630630
d_invalidate(victim); // avoid lost mounts
631-
if (d_is_dir(victim))
632-
fsnotify_rmdir(inode, victim);
633-
else
634-
fsnotify_unlink(inode, victim);
635631
if (callback)
636632
callback(victim);
633+
fsnotify_delete(inode, d_inode(victim), victim);
637634
dput(victim); // unpin it
638635
}
639636
if (victim == dentry) {

0 commit comments

Comments
 (0)