From: Darrick J. Wong Date: Thu, 20 Feb 2025 21:46:57 +0000 (-0800) Subject: dio_writeback_race: align the directio buffer to base page size X-Git-Tag: v2025.03.09~73 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=23b67c61d21310e70fba210050bc002e6c7cbd6d;p=xfstests-dev.git dio_writeback_race: align the directio buffer to base page size There's no need to align the memory buffer for the direcio write to the file allocation unit size; base page size will do. This fixes the following error when generic/761 is run against an XFS rt filesystem with a 28k rtextsize: QA output created by 761 +failed to allocate aligned memory +cat: /opt/foobar: No such file or directory Silence is golden Cc: # v2025.02.16 Fixes: 17fb49493426ad ("fstests: add a generic test to verify direct IO writes with buffer contents change") Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig Signed-off-by: Zorro Lang --- diff --git a/src/dio-writeback-race.c b/src/dio-writeback-race.c index 2d3156e5..cca7d0e3 100644 --- a/src/dio-writeback-race.c +++ b/src/dio-writeback-race.c @@ -102,7 +102,7 @@ int main (int argc, char *argv[]) fprintf(stderr, "missing argument\n"); goto error; } - ret = posix_memalign(&buf, blocksize, blocksize); + ret = posix_memalign(&buf, sysconf(_SC_PAGESIZE), blocksize); if (!buf) { fprintf(stderr, "failed to allocate aligned memory\n"); exit(EXIT_FAILURE);