diff mbox series

[v3,04/10] tracefs: call fsnotify_{unlink,rmdir}() hooks

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

Commit Message

Amir Goldstein May 26, 2019, 2:34 p.m. UTC
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>
---
 fs/tracefs/inode.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Amir Goldstein June 13, 2019, 4:53 p.m. UTC | #1
On Sun, May 26, 2019 at 5:34 PM Amir Goldstein <amir73il@gmail.com> wrote:
>
> 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>

Hi Steven,

Would you be able to provide an ACK on this patch?
We need to add those explicit fsnotify hooks to match the existing
fsnotify_create/mkdir hooks in tracefs, because
the hook embedded inside d_delete() is going away [1].

Thanks,
Amir.

[1] https://lore.kernel.org/linux-fsdevel/20190526143411.11244-1-amir73il@gmail.com/


> ---
>  fs/tracefs/inode.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c
> index 7098c49f3693..497a8682b5b9 100644
> --- a/fs/tracefs/inode.c
> +++ b/fs/tracefs/inode.c
> @@ -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)
> --
> 2.17.1
>
Steven Rostedt Aug. 30, 2019, 7:48 p.m. UTC | #2
On Thu, 13 Jun 2019 19:53:25 +0300
Amir Goldstein <amir73il@gmail.com> wrote:

> On Sun, May 26, 2019 at 5:34 PM Amir Goldstein <amir73il@gmail.com> wrote:
> >
> > 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>  
> 
> Hi Steven,
> 
> Would you be able to provide an ACK on this patch?
> We need to add those explicit fsnotify hooks to match the existing
> fsnotify_create/mkdir hooks in tracefs, because
> the hook embedded inside d_delete() is going away [1].
> 
> Thanks,
> Amir.
> 
> [1] https://lore.kernel.org/linux-fsdevel/20190526143411.11244-1-amir73il@gmail.com/
> 

Sorry, this got lost in my INBOX. I see it was already merged, but I
would have acked it ;-)

-- Steve
Jan Kara Sept. 2, 2019, 8:46 a.m. UTC | #3
On Fri 30-08-19 15:48:04, Steven Rostedt wrote:
> On Thu, 13 Jun 2019 19:53:25 +0300
> Amir Goldstein <amir73il@gmail.com> wrote:
> 
> > On Sun, May 26, 2019 at 5:34 PM Amir Goldstein <amir73il@gmail.com> wrote:
> > >
> > > 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>  
> > 
> > Hi Steven,
> > 
> > Would you be able to provide an ACK on this patch?
> > We need to add those explicit fsnotify hooks to match the existing
> > fsnotify_create/mkdir hooks in tracefs, because
> > the hook embedded inside d_delete() is going away [1].
> > 
> > Thanks,
> > Amir.
> > 
> > [1] https://lore.kernel.org/linux-fsdevel/20190526143411.11244-1-amir73il@gmail.com/
> > 
> 
> Sorry, this got lost in my INBOX. I see it was already merged, but I
> would have acked it ;-)

Thanks for the dealayed ack. I've used my best judgement and decided that
you probably would not object when pushing the patch :).
								Honza
diff mbox series

Patch

diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c
index 7098c49f3693..497a8682b5b9 100644
--- a/fs/tracefs/inode.c
+++ b/fs/tracefs/inode.c
@@ -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)