statx: add mount_root
[sfrench/cifs-2.6.git] / fs / stat.c
index 3d88c99f7743210bfae466800e0fb80f77d9b7d6..b9faa6cafafedb19f86d2f0e0f69eaa4f496bb24 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -202,6 +202,9 @@ 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 (path.mnt->mnt_root == path.dentry)
+               stat->attributes |= STATX_ATTR_MOUNT_ROOT;
+       stat->attributes_mask |= STATX_ATTR_MOUNT_ROOT;
        path_put(&path);
        if (retry_estale(error, lookup_flags)) {
                lookup_flags |= LOOKUP_REVAL;