debugfs: call fsnotify_{unlink,rmdir}() hooks
authorAmir Goldstein <amir73il@gmail.com>
Sun, 26 May 2019 14:34:08 +0000 (17:34 +0300)
committerJan Kara <jack@suse.cz>
Thu, 20 Jun 2019 12:47:09 +0000 (14:47 +0200)
This will allow generating fsnotify delete events after the
fsnotify_nameremove() hook is removed from d_delete().

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/debugfs/inode.c

index d89874d..1e444fe 100644 (file)
@@ -643,8 +643,11 @@ static int __debugfs_remove(struct dentry *dentry, struct dentry *parent)
                dget(dentry);
                if (d_is_dir(dentry)) {
                        ret = simple_rmdir(d_inode(parent), dentry);
+                       if (!ret)
+                               fsnotify_rmdir(d_inode(parent), dentry);
                } else {
                        simple_unlink(d_inode(parent), dentry);
+                       fsnotify_unlink(d_inode(parent), dentry);
                }
                if (!ret)
                        d_delete(dentry);