Skip to contentSkip to conversation

Inconsistent mount option for TEST_DIR after _test_cycle_mount()

DISCUSSION Qu Wenruo 1 participant 1 message Jun 1 Btrfs file system

lore
Share & tools
lore

Qu Wenruo

author
#0 lore raw

Hi,

Recently I'm testing btrfs with its nodatasum options to verify some direct IO bugs.

But it turns out _test_cycle_mount() doesn't respect $MOUNT_OPTIONS, and will cause mount options that affect new files to be not applied.

E.g, there is a super simple test case:

. ./common/preamble
_begin_fstest auto
_require_test
mount | grep "$TEST_DIR"
_test_cycle_mount
mount | grep "$TEST_DIR"
_exit 0

With MOUNT_OPTIONS set to "-o nodatasum", the output looks like the following:

/dev/mapper/test-test on /mnt/test type btrfs (rw,relatime,nodatasum,discard=async,space_cache=v2,subvolid=5,subvol=/) /dev/mapper/test-test on /mnt/test type btrfs (rw,relatime,discard=async,space_cache=v2,subvolid=5,subvol=/)

Note the missing "nodatasum" mount option after the _test_cycle_mount.

However I failed to find out how the initial _require_test is different from the later _test_cycle_mount.

They all call the same _test_mount(), and that function never really respect $MOUNT_OPTIONS, but still the first test mount still got the correct "nodatasum" option.

Any clue on how to fix this weird problem?

Thanks,
Qu