Merge tag 'vfs-6.8.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
[linux-2.6-block.git] / fs / stat.c
index 8a8f7e97a742380f636899c6a06908034a1e90ad..77cdc69eb4220b7764c4e551bf3a350debcec7f6 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -247,8 +247,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;