summaryrefslogtreecommitdiff
path: root/fs/configfs
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2019-05-26 17:34:09 +0300
committerJan Kara <jack@suse.cz>2019-06-20 15:47:21 +0300
commit6146e78c0364a881af9bec42eb40882b1e329327 (patch)
tree50ece0f9a5d8b950a2f110495f87c7543b16f610 /fs/configfs
parent6679ea6dea15ec2fa7e2dd3c11cce639270c4386 (diff)
downloadlinux-6146e78c0364a881af9bec42eb40882b1e329327.tar.xz
configfs: call fsnotify_rmdir() hook
This will allow generating fsnotify delete events on unregister of group/subsystem after the fsnotify_nameremove() hook is removed from d_delete(). The rest of the d_delete() calls from this filesystem are either called recursively from within debugfs_unregister_{group,subsystem}, called from a vfs function that already has delete hooks or are called from shutdown/cleanup code. Cc: Joel Becker <jlbec@evilplan.org> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/configfs')
-rw-r--r--fs/configfs/dir.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index 5e7932d668ab..ba17881a8d84 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -27,6 +27,7 @@
#undef DEBUG
#include <linux/fs.h>
+#include <linux/fsnotify.h>
#include <linux/mount.h>
#include <linux/module.h>
#include <linux/slab.h>
@@ -1804,6 +1805,7 @@ void configfs_unregister_group(struct config_group *group)
configfs_detach_group(&group->cg_item);
d_inode(dentry)->i_flags |= S_DEAD;
dont_mount(dentry);
+ fsnotify_rmdir(d_inode(parent), dentry);
d_delete(dentry);
inode_unlock(d_inode(parent));
@@ -1932,6 +1934,7 @@ void configfs_unregister_subsystem(struct configfs_subsystem *subsys)
configfs_detach_group(&group->cg_item);
d_inode(dentry)->i_flags |= S_DEAD;
dont_mount(dentry);
+ fsnotify_rmdir(d_inode(root), dentry);
inode_unlock(d_inode(dentry));
d_delete(dentry);