]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
generic/604: try to make race occur reliably
authorDarrick J. Wong <djwong@kernel.org>
Tue, 27 Feb 2024 04:40:21 +0000 (20:40 -0800)
committerZorro Lang <zlang@kernel.org>
Mon, 11 Mar 2024 04:50:09 +0000 (12:50 +0800)
commitd46a46c7d5d0c573faa7775c0c727e85e9ab7e4f
tree429b87366af4875a33bdd2438399565c5056b124
parent512dba4fdbfcd91a255159728e212f414531a8af
generic/604: try to make race occur reliably

This test will occasionaly fail like so:

  --- /tmp/fstests/tests/generic/604.out 2024-02-03 12:08:52.349924277 -0800
  +++ /var/tmp/fstests/generic/604.out.bad 2024-02-05 04:35:55.020000000 -0800
  @@ -1,2 +1,5 @@
   QA output created by 604
  -Silence is golden
  +mount: /opt: /dev/sda4 already mounted on /opt.
  +       dmesg(1) may have more information after failed mount system call.
  +mount -o usrquota,grpquota,prjquota, /dev/sda4 /opt failed
  +(see /var/tmp/fstests/generic/604.full for details)

As far as I can tell, the cause of this seems to be _scratch_mount
getting forked and exec'd before the backgrounded umount process has a
chance to enter the kernel.  When this occurs, the mount() system call
will return -EBUSY because this isn't an attempt to make a bind mount.
Slow things down slightly by stalling the mount by 10ms.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/604