Skip to content

Commit d6fc6c9

Browse files
amir73ilAndreas Gruenbacher
authored andcommitted
gfs2: fs: derive f_fsid from s_uuid
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 <[email protected]> Reviewed-by: Jan Kara <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 0b2355f commit d6fc6c9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/gfs2/super.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,7 @@ static int gfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
10061006
buf->f_files = sc.sc_dinodes + sc.sc_free;
10071007
buf->f_ffree = sc.sc_free;
10081008
buf->f_namelen = GFS2_FNAMESIZE;
1009+
buf->f_fsid = uuid_to_fsid(sb->s_uuid.b);
10091010

10101011
return 0;
10111012
}

0 commit comments

Comments
 (0)