Weird behaviour with cifs in xfstests shutdown tests

From: David Howells <dhowells@redhat.com>
Date: 2023-04-27 08:27:45
Also in: linux-cifs, linux-fsdevel

I'm seeing some failures running xfstests on cifs when it comes to tests that
do a shutdown of the filesystem, generic/392 for example:

generic/392       [failed, exit status 1]- output mismatch (see /root/xfstests-dev/results//smb3/generic/392.out.bad)
    --- tests/generic/392.out   2021-05-25 13:27:50.000000000 +0100
    +++ /root/xfstests-dev/results//smb3/generic/392.out.bad    2023-04-27 09:07:42.402657080 +0100
    @@ -1,11 +1,67 @@
     QA output created by 392
     ==== i_size 1024 test with fsync ====
    +stat: cannot statx '/xfstest.scratch/testfile': Input/output error
    +Before:  "b: 8194 s: 4195328 a: 2023-04-27 09:07:39.410675400 +0100 m: 2023-04-27 09:07:39.410675400 +0100 c: 2023-04-27 09:07:39.410675400 +0100"
    +After : 
    +rm: cannot remove '/xfstest.scratch/testfile': Input/output error
     ==== i_size 4096 test with fsync ====
    ...
    (Run 'diff -u /root/xfstests-dev/tests/generic/392.out /root/xfstests-dev/results//smb3/generic/392.out.bad'  to see the entire diff)

The problem appears to be that the CIFS_MOUNT_SHUTDOWN persists if there's
another cifs mount from the same server present.  So in generic/392 it does:

	before=`stat "$stat_opt" $testfile`

	$XFS_IO_PROG -c "$sync_mode" $testfile | _filter_xfs_io
	_scratch_shutdown | tee -a $seqres.full
	_scratch_cycle_mount

	after=`stat "$stat_opt" $testfile`

which cycles the *scratch* mount, but leaves the test mount still mounted and
then the 'after' stat fails with EIO.

Testing this by hand:

  mount //192.168.6.1/scratch /xfstest.scratch/ -o user=shares,pass=...;\
  touch /xfstest.scratch/testfile; \
  stat /xfstest.scratch/testfile; \
  ./src/godown /xfstest.scratch/; \
  umount /xfstest.scratch/; \
  mount //192.168.6.1/scratch /xfstest.scratch/ -o user=shares,pass=...; \
  stat /xfstest.scratch/testfile

works, but will fail if I do:

  mount //192.168.6.1/test /xfstest.test/ -o user=shares,pass=...;

first.

Interestingly, the two mounts have different device numbers according to stat,
so they would appear to have different superblocks.

David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help