From: Jeff Moyer Date: Wed, 3 Jun 2009 20:09:34 +0000 (-0500) Subject: aio-dio-regress: align I/O buffers to 4k for 4k sector devices X-Git-Tag: v1.1.0~280 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4683b6d261cb9e93a22c258d2d82082f0416b37c;p=users%2Fhch%2Fxfstests-dev.git aio-dio-regress: align I/O buffers to 4k for 4k sector devices (and virtual devices as found on s390) Without this patch, these tests can randomly fail on s390 systems which use a virtual block device with sector size of 4k. Testing confirms that this patch resolves the issue. Signed-off-by: Jeff Moyer Reviewed-by: Eric Sandeen --- diff --git a/src/aio-dio-regress/aio-dio-extend-stat.c b/src/aio-dio-regress/aio-dio-extend-stat.c index 4822fea28..c274e5820 100644 --- a/src/aio-dio-regress/aio-dio-extend-stat.c +++ b/src/aio-dio-regress/aio-dio-extend-stat.c @@ -46,7 +46,7 @@ #define BUFSIZE 1024 -static unsigned char buf[BUFSIZE] __attribute((aligned (512))); +static unsigned char buf[BUFSIZE] __attribute((aligned (4096))); /* * this was arbitrarily chosen to take about two seconds on a dual athlon in a diff --git a/src/aio-dio-regress/aio-dio-invalidate-failure.c b/src/aio-dio-regress/aio-dio-invalidate-failure.c index 98c453f3f..a1a5df2f7 100644 --- a/src/aio-dio-regress/aio-dio-invalidate-failure.c +++ b/src/aio-dio-regress/aio-dio-invalidate-failure.c @@ -54,7 +54,7 @@ /* This test never survived to 180 seconds on a single spindle */ #define SECONDS 200 -static unsigned char buf[GINORMOUS] __attribute((aligned (512))); +static unsigned char buf[GINORMOUS] __attribute((aligned (4096))); #define fail(fmt , args...) do {\ printf(fmt , ##args); \ diff --git a/src/aio-dio-regress/aio-dio-subblock-eof-read.c b/src/aio-dio-regress/aio-dio-subblock-eof-read.c index 960deba2a..cbcff97c4 100644 --- a/src/aio-dio-regress/aio-dio-subblock-eof-read.c +++ b/src/aio-dio-regress/aio-dio-subblock-eof-read.c @@ -49,7 +49,7 @@ do { \ exit(1); \ } while (0) -static unsigned char buffer[4096] __attribute((aligned (512))); +static unsigned char buffer[4096] __attribute((aligned (4096))); int main(int argc, char **argv)