Inconsistent mount option for TEST_DIR after _test_cycle_mount()

Qu Wenruo <[email protected]>
Newsgroups org.kernel.vger.fstests,org.kernel.vger.linux-btrfs
Message-ID <[email protected]>
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
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.