mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Charalampos Mitrodimas <charmitro@posteo.net>,
	 Eric Sandeen <sandeen@redhat.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 "Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>,
	 David Howells <dhowells@redhat.com>,
	linux-kernel@vger.kernel.org,
	 linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] debugfs: fix mount options not being applied
Date: Fri, 8 Aug 2025 16:13:51 +0200	[thread overview]
Message-ID: <20250808-aufrechnung-geizig-a99993c8e8f4@brauner> (raw)
In-Reply-To: <cf97c467-6391-44df-8ce3-570f533623b8@sandeen.net>

On Wed, Aug 06, 2025 at 11:33:11AM -0500, Eric Sandeen wrote:
> On 8/5/25 12:22 PM, Charalampos Mitrodimas wrote:
> > Eric Sandeen <sandeen@redhat.com> writes:
> > 
> >> On 8/4/25 12:22 PM, Eric Sandeen wrote:
> >>> On 8/4/25 9:30 AM, Charalampos Mitrodimas wrote:
> >>>> Mount options (uid, gid, mode) are silently ignored when debugfs is
> >>>> mounted. This is a regression introduced during the conversion to the
> >>>> new mount API.
> >>>>
> >>>> When the mount API conversion was done, the line that sets
> >>>> sb->s_fs_info to the parsed options was removed. This causes
> >>>> debugfs_apply_options() to operate on a NULL pointer.
> >>>>
> >>>> As an example, with the bug the "mode" mount option is ignored:
> >>>>
> >>>>   $ mount -o mode=0666 -t debugfs debugfs /tmp/debugfs_test
> >>>>   $ mount | grep debugfs_test
> >>>>   debugfs on /tmp/debugfs_test type debugfs (rw,relatime)
> >>>>   $ ls -ld /tmp/debugfs_test
> >>>>   drwx------ 25 root root 0 Aug  4 14:16 /tmp/debugfs_test
> >>>
> >>> Argh. So, this looks a lot like the issue that got fixed for tracefs in:
> >>>
> >>> e4d32142d1de tracing: Fix tracefs mount options
> >>>
> >>> Let me look at this; tracefs & debugfs are quite similar, so perhaps
> >>> keeping the fix consistent would make sense as well but I'll dig
> >>> into it a bit more.
> >>
> >> So, yes - a fix following the pattern of e4d32142d1de does seem to resolve
> >> this issue.
> >>
> >> However, I think we might be playing whack-a-mole here (fixing one fs at a time,
> >> when the problem is systemic) among filesystems that use get_tree_single()
> >> and have configurable options. For example, pstore:
> >>
> >> # umount /sys/fs/pstore 
> >>
> >> # mount -t pstore -o kmsg_bytes=65536 none /sys/fs/pstore
> >> # mount | grep pstore
> >> none on /sys/fs/pstore type pstore (rw,relatime,seclabel)
> >>
> >> # mount -o remount,kmsg_bytes=65536 /sys/fs/pstore
> >> # mount | grep pstore
> >> none on /sys/fs/pstore type pstore (rw,relatime,seclabel,kmsg_bytes=65536)
> >> #
> >>
> >> I think gadgetfs most likely has the same problem but I'm not yet sure
> >> how to test that.
> >>
> >> I have no real objection to merging your patch, though I like the
> >> consistency of following e4d32142d1de a bit more. But I think we should
> >> find a graceful solution so that any filesystem using get_tree_single
> >> can avoid this pitfall, if possible.
> > 
> > Hi, thanks for the review, and yes you're right.
> > 
> > Maybe a potential systemic fix would be to make get_tree_single() always
> > call fc->ops->reconfigure() after vfs_get_super() when reusing an
> > existing superblock, fixing all affected filesystems at once.
> 
> Yep, I'm looking into that. mount_single used to do this, and IIRC we discussed
> it before but for some reason opted not to. It seems a bit trickier than I first
> expected, but I might just be dense. ;)

If we can make it work generically, we should. I too don't remember what
the reasons were for not doing it that way.

  reply	other threads:[~2025-08-08 14:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-04 14:30 Charalampos Mitrodimas
2025-08-04 16:48 ` Greg Kroah-Hartman
2025-08-04 17:22 ` Eric Sandeen
2025-08-05 17:03   ` Eric Sandeen
2025-08-05 17:22     ` Charalampos Mitrodimas
2025-08-06 16:33       ` Eric Sandeen
2025-08-08 14:13         ` Christian Brauner [this message]
2025-08-13 22:02           ` Eric Sandeen
2025-08-13 23:49             ` Charalampos Mitrodimas
2025-08-14  9:05     ` Aleksa Sarai
2025-08-14 13:47       ` Aleksa Sarai
2025-08-14 16:46       ` Eric Sandeen
2025-08-15  0:31         ` Aleksa Sarai

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=20250808-aufrechnung-geizig-a99993c8e8f4@brauner \
    --to=brauner@kernel.org \
    --cc=charmitro@posteo.net \
    --cc=dakr@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=sandeen@redhat.com \
    --cc=sandeen@sandeen.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®