xfs: Print XFS UUID on mount and umount events.
RFC PATCH 1/1 xfs: Print XFS UUID on mount and umount events.
As of now only device names are pritend out over __xfs_printk(). The device names are not persistent across reboots which in case of searching for origin of corruption brings another task to properly indetify the devices. This patch add XFS UUID upon every mount/umount event which will make the identification much easier.
--- fs/xfs/xfs_log.c | 8 ++++---- fs/xfs/xfs_super.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
fs/xfs/xfs_log.c +4 -4
@@ -646,12 +646,12 @@ xfs_log_mount(int min_logfsbs;if (!(mp->m_flags &XFS_MOUNT_NORECOVERY )) { -xfs_notice (mp,"Mounting V%d Filesystem" , -XFS_SB_VERSION_NUM (&mp->m_sb)); +xfs_notice (mp,"Mounting V%d Filesystem %pU" , +XFS_SB_VERSION_NUM (&mp->m_sb), (void *)&mp->m_sb.sb_uuid); }else {xfs_notice (mp, -"Mounting V%d filesystem in no-recovery mode. Filesystem will be inconsistent." , -XFS_SB_VERSION_NUM (&mp->m_sb)); +"Mounting V%d filesystem %pU in no-recovery mode. Filesystem will be inconsistent." , +XFS_SB_VERSION_NUM (&mp->m_sb), (void *)&mp->m_sb.sb_uuid);ASSERT (mp->m_flags &XFS_MOUNT_RDONLY ); }
fs/xfs/xfs_super.c +1 -1
@@ -1063,7 +1063,7 @@ xfs_fs_put_super(if (!sb->s_fs_info)return ; -xfs_notice (mp,"Unmounting Filesystem" ); +xfs_notice (mp,"Unmounting Filesystem %pU" , (void *)&mp->m_sb.sb_uuid);xfs_filestream_unmount (mp);xfs_unmountfs (mp);
Signature · 1 line
2.31.1
Quoted 5 lines · Lukas Herbolt
As of now only device names are pritend out over
__xfs_printk(). The device names are not persistent across reboots which in case of searching for origin of corruption brings another task to properly indetify the devices. This patch add XFS UUID upon every mount/umount event which will make the identification much easier.
This looks sensible, but please avoid the pointless casts and overly long lines. i.e. something like this:
fs/xfs/xfs_log.c +6 -4
@@ -572,12 +572,14 @@ xfs_log_mount(int min_logfsbs;if (!(mp->m_flags &XFS_MOUNT_NORECOVERY )) { -xfs_notice (mp,"Mounting V%d Filesystem" , -XFS_SB_VERSION_NUM (&mp->m_sb)); +xfs_notice (mp,"Mounting V%d Filesystem %pU" , +XFS_SB_VERSION_NUM (&mp->m_sb), + &mp->m_sb.sb_uuid); }else {xfs_notice (mp, -"Mounting V%d filesystem in no-recovery mode. Filesystem will be inconsistent." , -XFS_SB_VERSION_NUM (&mp->m_sb)); +"Mounting V%d filesystem %pU in no-recovery mode. Filesystem will be inconsistent." , +XFS_SB_VERSION_NUM (&mp->m_sb), + &mp->m_sb.sb_uuid);ASSERT (mp->m_flags &XFS_MOUNT_RDONLY ); }
fs/xfs/xfs_super.c +1 -1
@@ -1043,7 +1043,7 @@ xfs_fs_put_super(if (!sb->s_fs_info)return ; -xfs_notice (mp,"Unmounting Filesystem" ); +xfs_notice (mp,"Unmounting Filesystem %pU" , &mp->m_sb.sb_uuid);xfs_filestream_unmount (mp);xfs_unmountfs (mp);