From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org, guaneryu@gmail.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me
Subject: [PATCH 6/6] aio-dio-append-write-fallocate-race: fix directio buffer alignment bugs
Date: Wed, 19 May 2021 16:57:16 -0700 [thread overview]
Message-ID: <162146863667.2500122.9363433713420860828.stgit@magnolia> (raw)
In-Reply-To: <162146860057.2500122.8732083536936062491.stgit@magnolia>
From: Darrick J. Wong <djwong@kernel.org>
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>
---
.../aio-dio-append-write-fallocate-race.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/aio-dio-regress/aio-dio-append-write-fallocate-race.c b/src/aio-dio-regress/aio-dio-append-write-fallocate-race.c
index 091b047d..d3a2e5fc 100644
--- a/src/aio-dio-regress/aio-dio-append-write-fallocate-race.c
+++ b/src/aio-dio-regress/aio-dio-append-write-fallocate-race.c
@@ -65,7 +65,7 @@ test(
}
blocksize = sbuf.st_blksize;
- ret = posix_memalign((void **)&buf, blocksize, blocksize);
+ ret = posix_memalign((void **)&buf, sysconf(_SC_PAGESIZE), blocksize);
if (ret) {
errno = ret;
perror("buffer");
next prev parent reply other threads:[~2021-05-19 23:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-19 23:56 [PATCHSET 0/6] fstests: miscellaneous fixes Darrick J. Wong
2021-05-19 23:56 ` [PATCH 1/6] common/xfs: refactor commands to select a particular xfs backing device Darrick J. Wong
2021-05-21 7:51 ` Christoph Hellwig
2021-05-19 23:56 ` [PATCH 2/6] xfs: force file creation to the data device for certain layout tests Darrick J. Wong
2021-05-21 7:56 ` Christoph Hellwig
2021-05-19 23:56 ` [PATCH 3/6] xfs/117: fix fragility in this fuzz test Darrick J. Wong
2021-05-21 7:59 ` Christoph Hellwig
2021-05-19 23:57 ` [PATCH 4/6] fsx/fsstress: round blocksize properly Darrick J. Wong
2021-05-21 8:02 ` Christoph Hellwig
2021-05-19 23:57 ` [PATCH 5/6] xfs/178: fix mkfs success test Darrick J. Wong
2021-05-21 8:04 ` Christoph Hellwig
2021-05-19 23:57 ` Darrick J. Wong [this message]
2021-05-21 8:08 ` [PATCH 6/6] aio-dio-append-write-fallocate-race: fix directio buffer alignment bugs Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=162146863667.2500122.9363433713420860828.stgit@magnolia \
--to=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=guan@eryu.me \
--cc=guaneryu@gmail.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.