debugfs: call fsnotify_{unlink,rmdir}() hooks

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>
This commit is contained in:
Amir Goldstein 2019-05-26 17:34:08 +03:00 committed by Jan Kara
parent 823e545c02
commit 6679ea6dea

View 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);