Linux filesystem development
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Eric Sandeen <sandeen@redhat.com>,
	linux-fsdevel@vger.kernel.org, brauner@kernel.org
Cc: viro@zeniv.linux.org.uk, neilb@suse.de, ebiederm@xmission.com,
	tony.luck@intel.com
Subject: Re: [PATCH 1/4] pstore: convert to the new mount API
Date: Wed, 05 Feb 2025 18:04:41 -0800	[thread overview]
Message-ID: <DD66BE90-95CD-4F75-AD47-50E869460482@kernel.org> (raw)
In-Reply-To: <20250205213931.74614-2-sandeen@redhat.com>



On February 5, 2025 1:34:29 PM PST, Eric Sandeen <sandeen@redhat.com> wrote:
>Convert the pstore filesystem to the new mount API.

Thanks for doing this!

> [...]
>+static const struct fs_parameter_spec pstore_param_spec[] = {
>+	fsparam_u32	("kmsg_bytes",	Opt_kmsg_bytes),
>+	{}

I am reminded to change the global to u32 (ulong is way too big), and fix the pstore_set_kmsg_bytes() prototype to be u32 not int. :)

> [...]
>+	/* pstore has historically ignored invalid kmsg_bytes param */
>+	if (opt < 0)
>+		return 0;

Seems like a warning would be at least user-friendly. ;) I can add that later.

> [...]
>@@ -431,19 +434,33 @@ static int pstore_fill_super(struct super_block *sb, void *data, int silent)
> 		return -ENOMEM;
> 
> 	scoped_guard(mutex, &pstore_sb_lock)
>-		pstore_sb = sb;
>+	pstore_sb = sb;

Shouldn't scoped_guard() induce a indent?

> 
> 	pstore_get_records(0);
> 
> 	return 0;
> }
> 
>-static struct dentry *pstore_mount(struct file_system_type *fs_type,
>-	int flags, const char *dev_name, void *data)
>+static int pstore_get_tree(struct fs_context *fc)
>+{
>+	if (fc->root)
>+		return pstore_reconfigure(fc);

I need to double check that changing kmsg_size out from under an active pstore won't cause problems, but it's probably okay. (Honestly I've been wanting to deprecate it as a mount option -- it really should just be a module param, but that's a separate task.)

Reviewed-by: Kees Cook <kees@kernel.org>

(Is it easier to take this via fs or via pstore?)

-Kees

-- 
Kees Cook

  reply	other threads:[~2025-02-06  2:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-05 21:34 [PATCH 0/4] fs: last of the pseudofs mount api conversions Eric Sandeen
2025-02-05 21:34 ` [PATCH 1/4] pstore: convert to the new mount API Eric Sandeen
2025-02-06  2:04   ` Kees Cook [this message]
2025-02-06  2:19     ` Eric Sandeen
2025-02-06  3:30       ` Kees Cook
2025-02-06 10:51       ` Christian Brauner
2025-02-05 21:34 ` [PATCH 2/4] vfs: Convert devpts to use " Eric Sandeen
2025-02-05 21:34 ` [PATCH 3/4] devtmpfs: replace ->mount with ->get_tree in public instance Eric Sandeen
2025-02-05 21:34 ` [PATCH 4/4] vfs: remove some unused old mount api code Eric Sandeen
2025-02-06 11:04 ` [PATCH 0/4] fs: last of the pseudofs mount api conversions Christian Brauner

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=DD66BE90-95CD-4F75-AD47-50E869460482@kernel.org \
    --to=kees@kernel.org \
    --cc=brauner@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=sandeen@redhat.com \
    --cc=tony.luck@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox