From: Jan Kara <jack@suse.cz>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
Jan Kara <jack@suse.cz>, Christian Brauner <brauner@kernel.org>,
linux-fsdevel@vger.kernel.org, Bob Peterson <rpeterso@redhat.com>,
gfs2@lists.linux.dev
Subject: Re: [PATCH] gfs2: fs: derive f_fsid from s_uuid
Date: Tue, 24 Oct 2023 11:42:37 +0200 [thread overview]
Message-ID: <20231024094237.6yykkw6hhoynofzv@quack3> (raw)
In-Reply-To: <20231024075535.2994553-1-amir73il@gmail.com>
On Tue 24-10-23 10:55:35, Amir Goldstein wrote:
> gfs2 already has optional persistent uuid.
>
> Use that uuid to report f_fsid in statfs(2), same as ext2/ext4/zonefs.
>
> This allows gfs2 to be monitored by fanotify filesystem watch.
> for example, with inotify-tools 4.23.8.0, the following command can be
> used to watch changes over entire filesystem:
>
> fsnotifywatch --filesystem /mnt/gfs2
>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
>
> Andreas,
>
> I do not have a test setup for gfs2, but this change it quite trivial,
> so I am posting it only compile tested.
>
> There is no need to test fanotify. It enough to test statfs returns
> a non-zero f_fsid, e.g.:
>
> strace -e fstatfs du /mnt/gfs2
>
> Thanks,
> Amir.
>
> fs/gfs2/super.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
> index 02d93da21b2b..ea769af6bb23 100644
> --- a/fs/gfs2/super.c
> +++ b/fs/gfs2/super.c
> @@ -1006,6 +1006,7 @@ static int gfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
> buf->f_files = sc.sc_dinodes + sc.sc_free;
> buf->f_ffree = sc.sc_free;
> buf->f_namelen = GFS2_FNAMESIZE;
> + buf->f_fsid = uuid_to_fsid(sb->s_uuid.b);
>
> return 0;
> }
> --
> 2.34.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2023-10-24 9:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-24 7:55 [PATCH] gfs2: fs: derive f_fsid from s_uuid Amir Goldstein
2023-10-24 9:42 ` Jan Kara [this message]
2023-10-24 11:15 ` Andreas Gruenbacher
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=20231024094237.6yykkw6hhoynofzv@quack3 \
--to=jack@suse.cz \
--cc=agruenba@redhat.com \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=gfs2@lists.linux.dev \
--cc=linux-fsdevel@vger.kernel.org \
--cc=rpeterso@redhat.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).