Skip to content

Commit ceb3388

Browse files
amir73ilbrauner
authored andcommitted
freevxfs: derive f_fsid from bdev->bd_dev
The majority of blockdev filesystems, which do not have a UUID in their on-disk format, derive f_fsid of statfs(2) from bdev->bd_dev. Use the same practice for freevxfs. This will allow reporting fanotify events with fanotify_event_info_fid. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Link: https://lore.kernel.org/r/20231024121457.3014063-1-amir73il@gmail.com Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent ae62bcb commit ceb3388

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/freevxfs/vxfs_super.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ vxfs_statfs(struct dentry *dentry, struct kstatfs *bufp)
7676
{
7777
struct vxfs_sb_info *infp = VXFS_SBI(dentry->d_sb);
7878
struct vxfs_sb *raw_sb = infp->vsi_raw;
79+
u64 id = huge_encode_dev(dentry->d_sb->s_bdev->bd_dev);
7980

8081
bufp->f_type = VXFS_SUPER_MAGIC;
8182
bufp->f_bsize = dentry->d_sb->s_blocksize;
@@ -84,6 +85,7 @@ vxfs_statfs(struct dentry *dentry, struct kstatfs *bufp)
8485
bufp->f_bavail = 0;
8586
bufp->f_files = 0;
8687
bufp->f_ffree = fs32_to_cpu(infp, raw_sb->vs_ifree);
88+
bufp->f_fsid = u64_to_fsid(id);
8789
bufp->f_namelen = VXFS_NAMELEN;
8890

8991
return 0;

0 commit comments

Comments
 (0)