diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-04-28 08:10:53 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2017-04-28 08:10:53 -0700 |
commit | 8f720d9f892e0e223dab8400f03130bc208c72e7 (patch) | |
tree | 7d14d367b051973f7415c780e45611895cc43593 /fs/xfs | |
parent | 3c3781951c9a155a56e5eed567349118374cc315 (diff) | |
download | linux-8f720d9f892e0e223dab8400f03130bc208c72e7.tar.gz linux-8f720d9f892e0e223dab8400f03130bc208c72e7.tar.bz2 linux-8f720d9f892e0e223dab8400f03130bc208c72e7.zip |
xfs: publish UUID in struct super_block
Copy the uuid of the filesystem to struct super_block s_uuid field,
as several other filesystems already do. Copy regardless of the nouuid
mount option, because other filesystems also do not guaranty uniqueness
of the s_uuid field in super_block struct.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_mount.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 688ebff1f663..2eaf81859166 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -73,6 +73,10 @@ xfs_uuid_mount( uuid_t *uuid = &mp->m_sb.sb_uuid; int hole, i; + /* Publish UUID in struct super_block */ + BUILD_BUG_ON(sizeof(mp->m_super->s_uuid) != sizeof(uuid_t)); + memcpy(&mp->m_super->s_uuid, uuid, sizeof(uuid_t)); + if (mp->m_flags & XFS_MOUNT_NOUUID) return 0; |