From: Eric Sandeen <sandeen@redhat.com>
To: "Marc Aurèle La France" <tsi@tuyoix.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Christian Brauner <brauner@kernel.org>,
David Howells <dhowells@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] debugfs show actual source in /proc/mounts
Date: Fri, 30 Aug 2024 08:38:31 -0500 [thread overview]
Message-ID: <ad3a24af-5366-4c20-ad46-6f21d6754bbe@redhat.com> (raw)
In-Reply-To: <883a7548-9e67-ccf6-23b7-c4e37934f840@tuyoix.net>
On 8/29/24 10:44 PM, Marc Aurèle La France wrote:
> After commit 0c07c273a5fe ("debugfs: continue to ignore unknown mount
> options"), debugfs displays "none" in /proc/mounts instead of the actual
> source. Fix this by recognising its "source" mount option.
>
> Signed-off-by: Marc Aurèle La France <tsi@tuyoix.net>
> Fixes: 0c07c273a5fe ("debugfs: continue to ignore unknown mount options")
> Cc: stable@vger.kernel.org # 6.10.x: 9f111059e725: fs_parse: add uid & gid option option parsing helpers
> Cc: stable@vger.kernel.org # 6.10.x: 49abee5991e1: debugfs: Convert to new uid/gid option parsing helpers
>
> diff -NRapruz -X /etc/diff.excludes linux-6.11.0-rc2/fs/debugfs/inode.c devel-6.11.0-rc2/fs/debugfs/inode.c
> --- linux-6.11.0-rc5/fs/debugfs/inode.c
> +++ devel-6.11.0-rc5/fs/debugfs/inode.c
> @@ -89,12 +89,14 @@ enum {
> Opt_uid,
> Opt_gid,
> Opt_mode,
> + Opt_source,
> };
>
> static const struct fs_parameter_spec debugfs_param_specs[] = {
> fsparam_gid ("gid", Opt_gid),
> fsparam_u32oct ("mode", Opt_mode),
> fsparam_uid ("uid", Opt_uid),
> + fsparam_string ("source", Opt_source),
> {}
> };
>
> @@ -126,6 +128,12 @@ static int debugfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
> case Opt_mode:
> opts->mode = result.uint_32 & S_IALLUGO;
> break;
Sorry for missing your earlier question, I was thinking that perhaps a
comment along the lines of this would be helpful:
/*
* Because debugfs accepts all mount options and indicates
* success even for unknown options, we must process "source"
* ourselves here; the vfs won't do it for us.
*/
> + case Opt_source:
> + if (fc->source)
> + return invalfc(fc, "Multiple sources specified");
> + fc->source = param->string;
> + param->string = NULL;
> + break;
but I suppose it's not a big deal unless others think it is.
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> /*
> * We might like to report bad mount options here;
> * but traditionally debugfs has ignored all mount options
>
next prev parent reply other threads:[~2024-08-30 13:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-10 19:25 Marc Aurèle La France
2024-08-13 9:54 ` Greg Kroah-Hartman
2024-08-13 19:18 ` Eric Sandeen
2024-08-14 4:50 ` Greg Kroah-Hartman
2024-08-14 15:20 ` Eric Sandeen
2024-08-14 15:26 ` Greg Kroah-Hartman
2024-08-19 1:29 ` Marc Aurèle La France
2024-08-30 3:44 ` Marc Aurèle La France
2024-08-30 13:38 ` Eric Sandeen [this message]
2024-08-31 3:51 ` Marc Aurèle La France
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=ad3a24af-5366-4c20-ad46-6f21d6754bbe@redhat.com \
--to=sandeen@redhat.com \
--cc=brauner@kernel.org \
--cc=dhowells@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=tsi@tuyoix.net \
/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
all inboxes | Powered by JetHome®