Re: [PATCH RFC] fstests: use MOUNT_OPTIONS to populate TEST_FS_MOUNT_OPTS if possible

Zorro Lang <[email protected]>
Newsgroups org.kernel.vger.fstests,org.kernel.vger.linux-btrfs
Message-ID <aiGYgLaQ7_r9LQ2G@zlang-mailbox>
On Mon, Jun 01, 2026 at 11:13:01PM -0700, Christoph Hellwig wrote:
> On Tue, Jun 02, 2026 at 09:44:22AM +0930, Qu Wenruo wrote:
> > If the test config only specifies "MOUNT_OPTIONS", but not
> > "TEST_FS_MOUNT_OPTS", the mount for TEST_DIR can have inconsistent flag
> > after _test_cycle_mount().
>
> AFAIK TEST_FS_MOUNT_OPTS gets overriden and isn't even a public option.
> It gets filled by fstype-sepcific options in _common_mount_opts.
> 
> This started to really confuse me lately when I was trying to test with
> mount options on the test fs.
> 
> I've looked at bit into the area but haven't come to a conclusion yet.
> The most recent change in this area is 1dd7395623cb ("common/config:
> Make test and scratch devices use the same mount options"), which didn't
> really make them common, adding to my confusion.
> 
> So I really think we need to fix things here, but right now I'm not sure
> how much of the current situation is intentional, and what our final
> goal is :(

Sorry for this terrible code logic.

AFAIK, TEST_FS_MOUNT_OPTS and MOUNT_OPTIONS serve different purposes:
TEST_FS_MOUNT_OPTS is used for TEST_DEV, while MOUNT_OPTIONS is used for
SCRATCH_DEV as well as loop or dm devices and so on. For instance, _test_mount
only applies TEST_FS_MOUNT_OPTS, whereas _scratch_mount only uses MOUNT_OPTIONS.
I used xfstests for over a decade, I typically configure both variables together
(often to the same values), so I didn't give them too much thought.

About the commit 1dd7395623cb, the subject of it would be better to be
"Make test and scratch devices use the same *default* mount options"
from ${FSTYP}_MOUNT_OPTIONS parameters. The original intent was not to merge
TEST_FS_MOUNT_OPTS and MOUNT_OPTIONS into a single variable.

About documentation, it is true that TEST_FS_MOUNT_OPTS is barely mentioned.
It is completely missing from the main README and only appears in other
sub-documents like README.config-sections. We should definitely clarify the
relationship between TEST_FS_MOUNT_OPTS and TEST_DEV, and metion that they
have no connection to MOUNT_OPTIONS.

Right now, the biggest inconsistent issue is probably with those feature-probing
helpers. They often check TEST_DIR to determine behaviors for SCRATCH_MNT. While
this works fine for features unaffected by mount options, but we might should
handle mount options related features (for TEST_DEV or SCRATCH_DEV) separately.

Thanks,
Zorro

>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.