Re: [PATCH v2] xfs: publish UUID in struct super_block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 28, 2017 at 05:00:01PM +0300, Amir Goldstein wrote:
> 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@xxxxxxxxx>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

--D

> ---
>  fs/xfs/xfs_mount.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> Darrick,
> 
> Per your request I moved the copy above nouuid check.
> 
> Cheers,
> Amir.
> 
> diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
> index 450bde6..4c0d8d7 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;
>  
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux