From: Amir Goldstein <amir73il@gmail.com>
To: Christoph Hellwig <hch@lst.de>, Joel Becker <jlbec@evilplan.org>
Cc: David Sterba <dsterba@suse.com>,
John Johansen <john.johansen@canonical.com>,
Trond Myklebust <trond.myklebust@hammerspace.com>,
Anna Schumaker <anna.schumaker@netapp.com>,
Steven Rostedt <rostedt@goodmis.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Al Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Jan Kara <jack@suse.cz>
Subject: Re: [PATCH v3 08/10] configfs: call fsnotify_rmdir() hook
Date: Thu, 30 May 2019 09:06:22 +0300 [thread overview]
Message-ID: <CAOQ4uxi+1xQW5eoH7r18DHjvQQyKeMGq2Qtbe1hcxtcmqA_hAg@mail.gmail.com> (raw)
In-Reply-To: <20190526143411.11244-9-amir73il@gmail.com>
On Sun, May 26, 2019 at 5:34 PM Amir Goldstein <amir73il@gmail.com> wrote:
>
> 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>
Hi Christoph and Joel,
Per Christoph's request, I cc'ed you guys on the entire patch series
for context,
so my discussion with Greg [1] about the special status of configfs in
this patch set
should already be somewhere in your mailboxes...
Could I ask you to provide an ACK on this patch and on the chosen
policy. To recap:
Before patch set:
1. User gets create/delete events when files/dirs created/removed via vfs_*()
2. User does *not* get create events when files/dirs created via
debugfs_register_*()
3. User *does* get delete events when files/dirs removed via
debugfs_unregister_*()
After patch set:
1. No change
2. No change
3. User will get delete events only on the root group/subsystem dir
when tree is removed via debugfs_unregister_*()
For symmetry, we could also add create events for root group/subsystem dir
when tree is created via debugfs_unregister_*(), but that would be a
followup patch.
For users though, it may be that delete events are more important than
create events
(i.e. for user cleanup tasks).
Thanks,
Amir.
[1] https://lore.kernel.org/linux-fsdevel/CAOQ4uxjyg5AVPrcR4bPm4zMY9BKmgV8g7TAuH--cfKNJv8pRYQ@mail.gmail.com/
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
> fs/configfs/dir.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> 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);
> --
> 2.17.1
>
next prev parent reply other threads:[~2019-05-30 6:06 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-26 14:34 [PATCH v3 00/10] Sort out fsnotify_nameremove() mess Amir Goldstein
2019-05-26 14:34 ` [PATCH v3 01/10] fsnotify: add empty fsnotify_{unlink,rmdir}() hooks Amir Goldstein
2019-05-26 14:34 ` [PATCH v3 02/10] btrfs: call fsnotify_rmdir() hook Amir Goldstein
2019-05-26 14:34 ` [PATCH v3 03/10] rpc_pipefs: call fsnotify_{unlink,rmdir}() hooks Amir Goldstein
2019-05-27 10:53 ` Jan Kara
2019-05-27 13:26 ` Amir Goldstein
2019-05-27 14:00 ` Jan Kara
2019-05-30 5:43 ` Amir Goldstein
2019-05-30 12:16 ` Trond Myklebust
2019-05-26 14:34 ` [PATCH v3 04/10] tracefs: " Amir Goldstein
2019-06-13 16:53 ` Amir Goldstein
2019-08-30 19:48 ` Steven Rostedt
2019-09-02 8:46 ` Jan Kara
2019-05-26 14:34 ` [PATCH v3 05/10] devpts: call fsnotify_unlink() hook Amir Goldstein
2019-05-26 14:34 ` [PATCH v3 06/10] debugfs: simplify __debugfs_remove_file() Amir Goldstein
2019-05-30 5:49 ` Amir Goldstein
2019-05-30 12:27 ` Greg KH
2019-06-03 13:31 ` Greg Kroah-Hartman
2019-05-26 14:34 ` [PATCH v3 07/10] debugfs: call fsnotify_{unlink,rmdir}() hooks Amir Goldstein
2019-06-03 13:31 ` Greg Kroah-Hartman
2019-05-26 14:34 ` [PATCH v3 08/10] configfs: call fsnotify_rmdir() hook Amir Goldstein
2019-05-30 6:06 ` Amir Goldstein [this message]
2019-06-13 16:57 ` Amir Goldstein
2019-05-26 14:34 ` [PATCH v3 09/10] fsnotify: move fsnotify_nameremove() hook out of d_delete() Amir Goldstein
2019-05-26 14:34 ` [PATCH v3 10/10] fsnotify: get rid of fsnotify_nameremove() Amir Goldstein
2019-05-27 8:24 ` [PATCH v3 00/10] Sort out fsnotify_nameremove() mess Greg Kroah-Hartman
2019-05-27 9:49 ` Amir Goldstein
2019-05-27 11:41 ` Greg Kroah-Hartman
2019-05-27 11:59 ` Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOQ4uxi+1xQW5eoH7r18DHjvQQyKeMGq2Qtbe1hcxtcmqA_hAg@mail.gmail.com \
--to=amir73il@gmail.com \
--cc=anna.schumaker@netapp.com \
--cc=dsterba@suse.com \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=jlbec@evilplan.org \
--cc=john.johansen@canonical.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=trond.myklebust@hammerspace.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).