]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
generic: Another SEEK_HOLE/SEEK_DATA sanity test
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 23 Jun 2017 00:11:16 +0000 (02:11 +0200)
committerEryu Guan <eguan@redhat.com>
Mon, 26 Jun 2017 07:20:14 +0000 (15:20 +0800)
commitd8e5df11f2b6daed41b73f477e46a5a96ed7feb4
treeb8690a4fda190a7b3da7c3c58aa9f23975406d6f
parentc56905614d9d11da46e5b236e9e6d476cc2a2925
generic: Another SEEK_HOLE/SEEK_DATA sanity test

Both ext4 and xfs have a bug in the page cache scanning code for
SEEK_HOLE / SEEK_DATA in unwritten extents: the start offset isn't
taken into account when scanning a page, so seeking can fail on
filesystems with a block size less than half of the page size.  For
example, the following command fails on a filesystem with a block
size of 1k:

  xfs_io -f -c "falloc 0 4k" \
            -c "pwrite 1k 1k" \
            -c "pwrite 3k 1k" \
            -c "seek -a -r 0" foo

Like with generic/436, the actual tests are added to seek_sanity_test.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
src/seek_sanity_test.c
tests/generic/445 [new file with mode: 0755]
tests/generic/445.out [new file with mode: 0644]
tests/generic/group