aio-dio-append-write-fallocate-race: fix directio buffer alignment bugs
authorDarrick J. Wong <djwong@kernel.org>
Wed, 19 May 2021 23:57:16 +0000 (16:57 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 23 May 2021 13:31:33 +0000 (21:31 +0800)
commit74128e70c4b60b509b9eaaba6c051b8745415aaf
treecd1b40454c1c2fa1039ca8d48e78b0115250a424
parent993887b25cefe3bfba02abdeab78969fdfe4d447
aio-dio-append-write-fallocate-race: fix directio buffer alignment bugs

This program fails on filesystems where the stat() block size isn't a
strict power of two because it foolishly feeds that to posix_memalign to
allocate an aligned memory buffer for directio.  posix_memalign requires
the alignment value to be a power of two, so generic/586 fails.

The system page size generally works well for directio buffers, so use
that instead.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
src/aio-dio-regress/aio-dio-append-write-fallocate-race.c