Re: [PATCH] xfs: Print XFS UUID on mount and umount events.

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

 



On Tue, Nov 01, 2022 at 12:19:06PM -0500, Eric Sandeen wrote:
> From: Lukas Herbolt <lukas@xxxxxxxxxxx>
> 
> As of now only device names are printed 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
> identify the devices. This patch add XFS UUID upon every mount/umount
> event which will make the identification much easier.
> 
> Signed-off-by: Lukas Herbolt <lukas@xxxxxxxxxxx>
> [sandeen: rebase onto current upstream kernel]
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>

Hi,

it is a simple enough, nonintrusive change so it may not really matter as
much, but I was wondering if there is a way to map the device name to
the fs UUID already and I think there may be.

I know that udev daemon is constantly scanning devices then they are
closed in order to be able to read the signatures. It should know
exactly what is on the device and I know it is able to track the history
of changes. What I am not sure about is whether it is already logged
somewhere?

If it's not already, maybe it can be done and then we can cross
reference kernel log with udev log when tracking down problems to see
exactly what is going on without needing to sprinkle UUIDs in kernel log ?

Any thoughts?

-Lukas

> ---
> 
> [resending this as it seems to have gotten lost, and looks to me like
> a trivial and useful enhancement to xfs logmessages. This was requested
> (and authored!) by our support folks.]
> 
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index f02a0dd522b3..0141d9907d31 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -644,12 +644,14 @@ xfs_log_mount(
>  	int		min_logfsbs;
> 
>  	if (!xfs_has_norecovery(mp)) {
> -		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(xfs_is_readonly(mp));
>  	}
> 
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index f029c6702dda..0ed477df6480 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -1110,7 +1110,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);
> 
> 
> 




[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