From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@gmail.com>
To: Dave Chinner <david@fromorbit.com>
Cc: fstests@vger.kernel.org, linux-ext4@vger.kernel.org,
linux-xfs@vger.kernel.org, ritesh.list@gmail.com,
ojaswin@linux.ibm.com, djwong@kernel.org, zlang@kernel.org
Subject: Re: [PATCH v1 3/3] xfs: Add a testcase to check remount with noattr2 on a v5 xfs
Date: Thu, 13 Feb 2025 15:30:50 +0530 [thread overview]
Message-ID: <b43e4cd9-d8aa-4cc0-a5ff-35f2e0553682@gmail.com> (raw)
In-Reply-To: <Z60W2U8raqzRKYdy@dread.disaster.area>
On 2/13/25 03:17, Dave Chinner wrote:
> On Wed, Feb 12, 2025 at 12:39:58PM +0000, Nirjhar Roy (IBM) wrote:
>> This testcase reproduces the following bug:
>> Bug:
>> mount -o remount,noattr2 <device> <mount_point> succeeds
>> unexpectedly on a v5 xfs when CONFIG_XFS_SUPPORT_V4 is set.
> AFAICT, this is expected behaviour. Remount intentionally ignores
> options that cannot be changed.
>
>> Ideally the above mount command should always fail with a v5 xfs
>> filesystem irrespective of whether CONFIG_XFS_SUPPORT_V4 is set
>> or not.
> No, we cannot fail remount when invalid options are passed to the
> kernel by the mount command for historical reasons. i.e. the mount
> command has historically passed invalid options to the kernel on
> remount, but expects the kernel to apply just the new options that
> they understand and ignore the rest without error.
>
> i.e. to keep compatibility with older userspace, we cannot fail a
> remount because userspace passed an option the kernel does not
> understand or cannot change.
>
> Hence, in this case, XFS emits a deprecation warning for the noattr2
> mount option on remount (because it is understood), then ignores
> because it it isn't a valid option that remount can change.
Thank you, Dave, for the background. This was really helpful. So just to
confirm the behavior of mount - remount with noattr2 (or any other
invalid option) should always pass irrespective of whether
CONFIG_XFS_SUPPORT_V4 is set or not, correct?
This is the behavior that I have observed with CONFIG_XFS_SUPPORT_V4=n
on v5 xfs:
$ mount -o "remount,noattr2" /dev/loop0 /mnt1/test
mount: /mnt1/test: mount point not mounted or bad option.
$ echo "$?"
32
With this test, I am also parallelly working on a kernel fix to make the
behavior of remount with noattr2 same irrespective of the
CONFIG_XFS_SUPPORT_V4's value, and I was under the impression that it
should always fail. But, it seems like it should always pass (silently
ignoring the invalid mount options) and the failure when
CONFIG_XFS_SUPPORT_V4=n is a bug. Is my understanding correct?
--NR
>
> -Dave.
--
Nirjhar Roy
Linux Kernel Developer
IBM, Bangalore
next prev parent reply other threads:[~2025-02-13 10:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 12:39 [PATCH v1 0/3] Add mount and remount related tests Nirjhar Roy (IBM)
2025-02-12 12:39 ` [PATCH v1 1/3] xfs/539: Skip noattr2 remount option on v5 filesystems Nirjhar Roy (IBM)
2025-02-12 21:01 ` Dave Chinner
2025-02-13 10:08 ` Nirjhar Roy (IBM)
2025-02-24 4:50 ` Nirjhar Roy (IBM)
2025-02-12 21:06 ` Darrick J. Wong
2025-02-12 12:39 ` [PATCH v1 2/3] common/xfs: Add a new helper function to check v5 XFS Nirjhar Roy (IBM)
2025-02-12 21:23 ` Dave Chinner
2025-02-12 12:39 ` [PATCH v1 3/3] xfs: Add a testcase to check remount with noattr2 on a v5 xfs Nirjhar Roy (IBM)
2025-02-12 21:47 ` Dave Chinner
2025-02-13 10:00 ` Nirjhar Roy (IBM) [this message]
2025-02-13 21:49 ` Dave Chinner
2025-02-17 4:48 ` Nirjhar Roy (IBM)
2025-02-17 22:29 ` Dave Chinner
2025-02-19 15:04 ` Nirjhar Roy (IBM)
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=b43e4cd9-d8aa-4cc0-a5ff-35f2e0553682@gmail.com \
--to=nirjhar.roy.lists@gmail.com \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=zlang@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