]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
xfs/420: fix occasional test failures due to pagecache readahead
authorDarrick J. Wong <djwong@kernel.org>
Wed, 16 Mar 2022 03:30:20 +0000 (20:30 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 10 Apr 2022 12:33:04 +0000 (20:33 +0800)
commitbc593bd327e0c1e7ed67051d88c81fe3d09d9536
tree9ccfd8873b3263e23d9c6a5c946bd769030e1215
parent58331382174eaa8aedd72223906fb1265b450687
xfs/420: fix occasional test failures due to pagecache readahead

Every now and then, this test fails with this golden output:

  --- xfs/420.out
  +++ xfs/420.out.bad
  @@ -29,7 +29,7 @@
   Whence Result
   DATA   0
   HOLE   131072
  -DATA   196608
  +DATA   192512
   HOLE   262144
   Compare files
   c2803804acc9936eef8aab42c119bfac  SCRATCH_MNT/test-420/file1

Curiously, the file checksums always match, and it's not *forbidden* for
the page cache to have a page backing an unwritten extent that hasn't
been written.

The condition that this test cares about is that block 3 (192k-256k) are
reported by SEEK_DATA as data even if the data fork has a hole and the
COW fork has an unwritten extent.  Matthew Wilcox thinks this is a side
effect of readahead.

To fix this occasional false failure, call SEEK_DATA and SEEK_HOLE only
on the offsets that we care about.

Suggested-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/420