public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: lukas@herbolt.com
Cc: Christoph Hellwig <hch@infradead.org>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH RFC v2] xfs: Print XFS UUID on mount and umount events.
Date: Fri, 21 May 2021 09:06:19 -0700	[thread overview]
Message-ID: <20210521160619.GF2207430@magnolia> (raw)
In-Reply-To: <1c29341ea9b5e362cd3252887ad01879@herbolt.com>

On Fri, May 21, 2021 at 11:03:11AM +0200, lukas@herbolt.com wrote:
> > Are you going to wire up fs uuid logging for the other filesystems that
> > support them?
> Well, I wasn't planning to but I can take a look on other FS as well
> Ext4 and Btrfs for start.
> 
> > What happens w.r.t. uuid disambiguation if someone uses a nouuid mount
> > to mount a filesystem with the same uuid as an already-mounted xfs?
> 
> I a not sure I understand the "nouuid mount". I don't think there can
> be XFS with empty uuid value in SB. And printing the message is independent
> on the mount method (mount UUID="" ...; mount /dev/sdX ...;).

I meant specifically:

mount /dev/mapper/fubar /mnt
<snapshot fubar to fubar.bak>

Oh no, I deleted something in fubar, let's retrieve it from fubar.bak!

mount /dev/mapper/fubar.bak /opt	# fails because same uuid as fubar
mount /dev/mapper/fubar.bak /opt -o nouuid

--D

> 
> 
> On 20.05.2021 17:23, Darrick J. Wong wrote:
> > On Wed, May 19, 2021 at 05:22:48PM +0200, Lukas Herbolt wrote:
> > > 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.
> > 
> > A few questions....
> > 
> > Are you going to wire up fs uuid logging for the other filesystems that
> > support them?
> > 
> > What happens w.r.t. uuid disambiguation if someone uses a nouuid mount
> > to mount a filesystem with the same uuid as an already-mounted xfs?
> > 
> > The changes themselves look ok, but I'm wondering what the use case is
> > here.
> > 
> > --D
> > 
> > > 
> > > Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
> > > ---
> > > V2: Drop void casts and fix long lines
> > > 
> > >  fs/xfs/xfs_log.c   | 10 ++++++----
> > >  fs/xfs/xfs_super.c |  2 +-
> > >  2 files changed, 7 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> > > index 06041834daa31..8f4f671fd80d5 100644
> > > --- a/fs/xfs/xfs_log.c
> > > +++ b/fs/xfs/xfs_log.c
> > > @@ -570,12 +570,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);
> > >  	}
> > > 
> > > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> > > index e5e0713bebcd8..a4b8a5ad8039f 100644
> > > --- a/fs/xfs/xfs_super.c
> > > +++ b/fs/xfs/xfs_super.c
> > > @@ -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);
> > > 
> > > --
> > > 2.31.1
> > > 

  reply	other threads:[~2021-05-21 16:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 15:22 [PATCH RFC v2] xfs: Print XFS UUID on mount and umount events Lukas Herbolt
2021-05-20 15:23 ` Darrick J. Wong
2021-05-21  9:03   ` lukas
2021-05-21 16:06     ` Darrick J. Wong [this message]
2021-05-21 16:11       ` Eric Sandeen
2021-05-21 17:13       ` Lukas Herbolt
2022-06-03 16:14 ` Eric Sandeen
2022-06-04  0:34   ` Darrick J. Wong
2022-06-06 14:05     ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210521160619.GF2207430@magnolia \
    --to=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=lukas@herbolt.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox