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]> 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 <>
Acked-by: David Sterba <>
Signed-off-by: Jan Kara <>

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,
    err = btrfs_delete_subvolume(dir, dentry);
-   if (!err)
+   if (!err) {
+       fsnotify_rmdir(dir, dentry);
+   }


Leave a Reply

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