diff mbox series

[v2,11/14] fsnotify: call fsnotify_rmdir() hook from configfs

Message ID 20190516102641.6574-12-amir73il@gmail.com (mailing list archive)
State New, archived
Headers show
Series Sort out fsnotify_nameremove() mess | expand

Commit Message

Amir Goldstein May 16, 2019, 10:26 a.m. UTC
This will allow generating fsnotify delete events after the
fsnotify_nameremove() hook is removed from d_delete().

Cc: Joel Becker <jlbec@evilplan.org>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 fs/configfs/dir.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Christoph Hellwig May 16, 2019, 12:33 p.m. UTC | #1
On Thu, May 16, 2019 at 01:26:38PM +0300, Amir Goldstein wrote:
> This will allow generating fsnotify delete events after the
> fsnotify_nameremove() hook is removed from d_delete().

This seems to be missing 13 patches of context without it isn't
reviewable.  If you decide to Cc someone either make sure they get all
the patches or just don't bother to start with.
Amir Goldstein May 16, 2019, 1:38 p.m. UTC | #2
On Thu, May 16, 2019 at 3:33 PM Christoph Hellwig <hch@lst.de> wrote:
>
> On Thu, May 16, 2019 at 01:26:38PM +0300, Amir Goldstein wrote:
> > This will allow generating fsnotify delete events after the
> > fsnotify_nameremove() hook is removed from d_delete().
>
> This seems to be missing 13 patches of context without it isn't
> reviewable.  If you decide to Cc someone either make sure they get all
> the patches or just don't bother to start with.

You are right. I wanted to avoid spamming all fs maintainers which all
individual fs patches, but should have CC'ed all on the cover letter and
the dependency patches 2-3:
https://lore.kernel.org/linux-fsdevel/20190516122506.GF13274@quack2.suse.cz/

I will go a head and manually forward those messages to all affected
maintainers.

Thanks,
Amir.
diff mbox series

Patch

diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index 591e82ba443c..2356008029f7 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>
@@ -1797,6 +1798,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));
 
@@ -1925,6 +1927,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);