All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xfs: publish UUID in struct super_block
@ 2017-04-28 14:00 Amir Goldstein
  2017-04-28 15:13 ` Darrick J. Wong
  2017-05-02  7:30 ` Christoph Hellwig
  0 siblings, 2 replies; 12+ messages in thread
From: Amir Goldstein @ 2017-04-28 14:00 UTC (permalink / raw)
  To: Darrick J . Wong
  Cc: Christoph Hellwig, Miklos Szeredi, Vivek Goyal, Al Viro,
	linux-xfs, linux-unionfs, linux-fsdevel

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>
---
 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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-05-02 18:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-28 14:00 [PATCH v2] xfs: publish UUID in struct super_block Amir Goldstein
2017-04-28 15:13 ` Darrick J. Wong
2017-05-02  7:30 ` Christoph Hellwig
2017-05-02 14:13   ` Amir Goldstein
2017-05-02 14:17     ` Christoph Hellwig
2017-05-02 14:27       ` Amir Goldstein
2017-05-02 14:47         ` Christoph Hellwig
2017-05-02 15:08           ` Miklos Szeredi
2017-05-02 15:17             ` Christoph Hellwig
2017-05-02 17:09           ` Amir Goldstein
2017-05-02 18:25             ` Amir Goldstein
2017-05-02 18:30               ` Richard Weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.