diff options
Diffstat (limited to 'fs/stat.c')
-rw-r--r-- | fs/stat.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/stat.c b/fs/stat.c index 24bb0209e459..e44f0625c24f 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -243,8 +243,13 @@ retry: error = vfs_getattr(&path, stat, request_mask, flags); - stat->mnt_id = real_mount(path.mnt)->mnt_id; - stat->result_mask |= STATX_MNT_ID; + if (request_mask & STATX_MNT_ID_UNIQUE) { + stat->mnt_id = real_mount(path.mnt)->mnt_id_unique; + stat->result_mask |= STATX_MNT_ID_UNIQUE; + } else { + stat->mnt_id = real_mount(path.mnt)->mnt_id; + stat->result_mask |= STATX_MNT_ID; + } if (path.mnt->mnt_root == path.dentry) stat->attributes |= STATX_ATTR_MOUNT_ROOT; |