btrfs: call fsnotify_rmdir() hook [Linux 5.3]

This Linux kernel change "btrfs: call fsnotify_rmdir() hook" is included in the Linux 5.3 release. This change is authored by Amir Goldstein <amir73il [at] gmail.com> on Sun May 26 17:34:03 2019 +0300. The commit for this change in Linux stable tree is 46008d9 (patch).

btrfs: call fsnotify_rmdir() hook

This will allow generating fsnotify delete events after the
fsnotify_nameremove() hook is removed from d_delete().

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Acked-by: David Sterba <dsterba@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>

There are 4 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 fs/btrfs/ioctl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 6dafa85..2cfd1bf 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2930,8 +2930,10 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
    inode_lock(inode);
    err = btrfs_delete_subvolume(dir, dentry);
    inode_unlock(inode);
-   if (!err)
+   if (!err) {
+       fsnotify_rmdir(dir, dentry);
        d_delete(dentry);
+   }

 out_dput:
    dput(dentry);

Leave a Reply

Your email address will not be published. Required fields are marked *