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

Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/tracefs/inode.c

index 7098c49..497a868 100644 (file)
@@ -509,9 +509,12 @@ static int __tracefs_remove(struct dentry *dentry, struct dentry *parent)
                        switch (dentry->d_inode->i_mode & S_IFMT) {
                        case S_IFDIR:
                                ret = simple_rmdir(parent->d_inode, dentry);
+                               if (!ret)
+                                       fsnotify_rmdir(parent->d_inode, dentry);
                                break;
                        default:
                                simple_unlink(parent->d_inode, dentry);
+                               fsnotify_unlink(parent->d_inode, dentry);
                                break;
                        }
                        if (!ret)