generic: test race between appending AIO DIO and fallocate
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 13 Nov 2019 02:44:16 +0000 (18:44 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 1 Dec 2019 15:13:14 +0000 (23:13 +0800)
commitd38fc1527d0ebb1c4f81d9e85a85e7dd34bea3d1
treec78f97d423bc88d5090e2298ee17eba87381f89c
parent5e6b248c6668b4c1c1a0d512ba907920bfaa6eea
generic: test race between appending AIO DIO and fallocate

Dave Chinner reports[1] that an appending AIO DIO write to the second
block of a zero-length file and an fallocate request to the first block
of the same file can race to set isize, with the user-visible end result
that the file size is set incorrectly to one block long.  Write a small
test to reproduce the results.

[1] https://lore.kernel.org/linux-xfs/20191029100342.GA41131@bfoster/T/

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
.gitignore
src/aio-dio-regress/aio-dio-append-write-fallocate-race.c [new file with mode: 0644]
tests/generic/586 [new file with mode: 0755]
tests/generic/586.out [new file with mode: 0644]
tests/generic/group