All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Kent <raven@themaw.net>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs <linux-xfs@vger.kernel.org>,
	Dave Chinner <dchinner@redhat.com>,
	David Howells <dhowells@redhat.com>,
	Al Viro <viro@ZenIV.linux.org.uk>
Subject: Re: [PATCH 03/10] xfs: mount-api - add xfs_parse_param()
Date: Thu, 27 Jun 2019 11:35:53 +0800	[thread overview]
Message-ID: <224f3629edfceb8e36a91b9451366b80aaef15cd.camel@themaw.net> (raw)
In-Reply-To: <6dc984b1eb55d201c95314d146fbeafb45d71c03.camel@themaw.net>

On Tue, 2019-06-25 at 07:47 +0800, Ian Kent wrote:
> +	default:
> > > +		return invalf(fc, "XFS: unknown mount option [%s].", param-
> > > > key);
> > 
> > What do these messages end up looking like in dmesg?
> > 
> > The reason I ask is that today when mount option processing fails we log
> > the device name in the error message:
> > 
> > # mount /dev/sda1 /mnt -o gribblegronk
> > [64010.878477] XFS (sda1): unknown mount option [gribblegronk].
> > 
> > AFAICT using invalf (instead of xfs_warn) means that now we don't report
> > the device name, and all you'd get is:
> > 
> > "[64010.878477] XFS: unknown mount option [gribblegronk]."
> > 
> > which is not as helpful...
> 
> Yes, I thought that might be seen as a problem.
> 
> The device name was obtained from the super block in the the
> original code and the super block isn't available at this
> point.
> 
> Not sure what to do about it but I'll have a look.
> 

It turns out that I also made a mistake with the error string.

The above would actually print (something like):
[64010.878477] xfs: XFS: unknown mount option [gribblegronk]."

I can change the case of the struct fs_parameter_description
.name and leave out the "XFS" in the error string to fix that.

But, because the parameter parsing is done before super block
creation, there's no bdev to get a device name from.

There should be a source (block device path) filed set in
the fs context and I could dup the last component of that
or walk the path to resolve symlinks and dup the path
dentry d_name which should give (something like) the
device name.

But the printk %pg format is a bit different in the way
it constructs the name from the bdev so it could well be
different.

That could lead to confusion too.

Also, if an error is occurs in the VFS the message won't
have the device name either.

So I'm not sure what to do about this one, suggestions?

Ian

  reply	other threads:[~2019-06-27  3:35 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24  2:58 [PATCH 01/10] xfs: mount-api - add fs parameter description Ian Kent
2019-06-24  2:58 ` [PATCH 02/10] xfs: mount-api - refactor suffix_kstrtoint() Ian Kent
2019-06-24 17:29   ` Darrick J. Wong
2019-06-24 22:35     ` Dave Chinner
2019-06-24 23:06       ` Darrick J. Wong
2019-06-24 23:34         ` Ian Kent
2019-06-24  2:58 ` [PATCH 03/10] xfs: mount-api - add xfs_parse_param() Ian Kent
2019-06-24 17:26   ` Darrick J. Wong
2019-06-24 23:47     ` Ian Kent
2019-06-27  3:35       ` Ian Kent [this message]
2019-06-24  2:58 ` [PATCH 04/10] xfs: mount-api - refactor xfs_fs_fill_super() Ian Kent
2019-06-24  2:58 ` [PATCH 05/10] xfs: mount-api - add xfs_get_tree() Ian Kent
2019-06-24 17:44   ` Darrick J. Wong
2019-06-24 23:52     ` Ian Kent
2019-06-24  2:58 ` [PATCH 06/10] xfs: mount api - add xfs_reconfigure() Ian Kent
2019-06-24 17:55   ` Darrick J. Wong
2019-06-25  0:00     ` Ian Kent
2019-06-24  2:59 ` [PATCH 07/10] xfs: mount-api - add xfs_fc_free() Ian Kent
2019-06-24 17:56   ` Darrick J. Wong
2019-06-25  0:01     ` Ian Kent
2019-06-24  2:59 ` [PATCH 08/10] xfs: mount-api - switch to new mount-api Ian Kent
2019-06-24  2:59 ` [PATCH 09/10] xfs: mount-api - remove legacy mount functions Ian Kent
2019-06-24  2:59 ` [PATCH 10/10] xfs: mount-api - rename xfs_fill_super() Ian Kent
2019-06-24 17:59   ` Darrick J. Wong
2019-06-24 17:59 ` [PATCH 01/10] xfs: mount-api - add fs parameter description Darrick J. Wong
2019-06-25 10:34 ` Christoph Hellwig
2019-06-25 10:55   ` Ian Kent
2019-08-21 14:52 ` Eric Sandeen
2019-08-22  9:05   ` Ian Kent
2019-08-22 17:17     ` 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=224f3629edfceb8e36a91b9451366b80aaef15cd.camel@themaw.net \
    --to=raven@themaw.net \
    --cc=darrick.wong@oracle.com \
    --cc=dchinner@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.