[Devel] [PATCH RH9 08/10] xfs: Zero uuid if it's not valid

Kirill Tkhai ktkhai at virtuozzo.com
Tue Jan 25 15:23:25 MSK 2022


mp->m_super->s_uuid is not used in xfs and generic fs code,
so we safely zero it for determinity in fs event code.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 fs/xfs/xfs_mount.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index d0755494597f..e112182afccd 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -62,8 +62,14 @@ xfs_uuid_mount(
 	/* Publish UUID in struct super_block */
 	uuid_copy(&mp->m_super->s_uuid, uuid);
 
-	if (mp->m_flags & XFS_MOUNT_NOUUID)
+	if (mp->m_flags & XFS_MOUNT_NOUUID) {
+		/*
+		 * mp->m_super->s_uuid is not used in xfs and generic fs code,
+		 * so we safely zero it for determinity in fs event code.
+		 */
+		uuid_copy(&mp->m_super->s_uuid, &uuid_null);
 		return 0;
+	}
 
 	if (uuid_is_null(uuid)) {
 		xfs_warn(mp, "Filesystem has null UUID - can't mount");




More information about the Devel mailing list