From: "Darrick J. Wong" <djwong@kernel.org>
To: Carlos Maiolino <cem@kernel.org>
Cc: hch@lst.de, stable@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/4] xfs: always warn about deprecated mount options
Date: Wed, 22 Oct 2025 09:12:02 -0700 [thread overview]
Message-ID: <20251022161202.GN3356773@frogsfrogsfrogs> (raw)
In-Reply-To: <dduztn5x2drvcafdcnvk6jvnmgdteh6wjnzswkrrjhrx7tcwvd@z7s5ej7lvlxs>
On Wed, Oct 22, 2025 at 10:00:55AM +0200, Carlos Maiolino wrote:
> On Tue, Oct 21, 2025 at 11:30:12AM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> >
> > The deprecation of the 'attr2' mount option in 6.18 wasn't entirely
> > successful because nobody noticed that the kernel never printed a
> > warning about attr2 being set in fstab if the only xfs filesystem is the
> > root fs; the initramfs mounts the root fs with no mount options; and the
> > init scripts only conveyed the fstab options by remounting the root fs.
>
> This is a weird behavior IMHO, as far as I remember not all mount options should
> necessarily work with remount and what the initramfs initially mounted
> might not reflect the reality the user expects. Assuming the 'remount'
> used here does not mean unmounting/mounting the root fs, but using mount
> -o remount...
Yes, this is a ... weird quirk of the initramfs behavior where it mounts
the rootfs with no mount options, grabs the intended mount options out
of /etc/fstab, and then mount / -o remount,$fstaboptions. In that case
there's no warning if the fstab options contain 'attr2'.
> This is not a concern this patch should consider though, it looks fine
> as-is.
>
> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Thanks!
--D
>
> >
> > Fix this by making it complain all the time.
> >
> > Cc: <stable@vger.kernel.org> # v5.13
> > Fixes: 92cf7d36384b99 ("xfs: Skip repetitive warnings about mount options")
> > Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> > Reviewed-by: Christoph Hellwig <hch@lst.de>
> > ---
> > fs/xfs/xfs_super.c | 25 +++++++++++++++++--------
> > 1 file changed, 17 insertions(+), 8 deletions(-)
> >
> >
> > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> > index e85a156dc17d16..ae9b17730eaf41 100644
> > --- a/fs/xfs/xfs_super.c
> > +++ b/fs/xfs/xfs_super.c
> > @@ -1373,16 +1373,25 @@ suffix_kstrtoull(
> > static inline void
> > xfs_fs_warn_deprecated(
> > struct fs_context *fc,
> > - struct fs_parameter *param,
> > - uint64_t flag,
> > - bool value)
> > + struct fs_parameter *param)
> > {
> > - /* Don't print the warning if reconfiguring and current mount point
> > - * already had the flag set
> > + /*
> > + * Always warn about someone passing in a deprecated mount option.
> > + * Previously we wouldn't print the warning if we were reconfiguring
> > + * and current mount point already had the flag set, but that was not
> > + * the right thing to do.
> > + *
> > + * Many distributions mount the root filesystem with no options in the
> > + * initramfs and rely on mount -a to remount the root fs with the
> > + * options in fstab. However, the old behavior meant that there would
> > + * never be a warning about deprecated mount options for the root fs in
> > + * /etc/fstab. On a single-fs system, that means no warning at all.
> > + *
> > + * Compounding this problem are distribution scripts that copy
> > + * /proc/mounts to fstab, which means that we can't remove mount
> > + * options unless we're 100% sure they have only ever been advertised
> > + * in /proc/mounts in response to explicitly provided mount options.
> > */
> > - if ((fc->purpose & FS_CONTEXT_FOR_RECONFIGURE) &&
> > - !!(XFS_M(fc->root->d_sb)->m_features & flag) == value)
> > - return;
> > xfs_warn(fc->s_fs_info, "%s mount option is deprecated.", param->key);
> > }
> >
> >
>
next prev parent reply other threads:[~2025-10-22 16:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-21 18:29 [PATCHSET] xfs: random fixes for 6.18 Darrick J. Wong
2025-10-21 18:29 ` [PATCH 1/4] xfs: don't set bt_nr_sectors to a negative number Darrick J. Wong
2025-10-21 18:30 ` [PATCH 2/4] xfs: always warn about deprecated mount options Darrick J. Wong
2025-10-22 8:00 ` Carlos Maiolino
2025-10-22 16:12 ` Darrick J. Wong [this message]
2025-10-21 18:30 ` [PATCH 3/4] xfs: loudly complain about defunct " Darrick J. Wong
2025-10-22 4:16 ` Christoph Hellwig
2025-10-21 18:30 ` [PATCH 4/4] xfs: fix locking in xchk_nlinks_collect_dir Darrick J. Wong
2025-10-22 4:16 ` Christoph Hellwig
2025-10-22 11:32 ` [PATCHSET] xfs: random fixes for 6.18 Carlos Maiolino
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=20251022161202.GN3356773@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=cem@kernel.org \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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