[Devel] [PATCH RHEL9 COMMIT] xfs: Zero uuid if it's not valid

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jan 27 17:36:56 MSK 2022


The commit is pushed to "branch-rh9-5.14.0-4.vz9.12.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-4.vz9.12.2
------>
commit e83ac790ebe03de59295d74ca972b578a89fb6d3
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Thu Jan 27 17:36:56 2022 +0300

    xfs: Zero uuid if it's not valid
    
    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>
    
    ====================
    xfs: Add notification about fs events like for ext4
    
    This patchset generalizes ext4's related code and introduced the same
    uevent notifications for xfs.
    
    https://jira.sw.ru/browse/PSBM-135476
    Feature: fs: udev events support
---
 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