From: Wu Bo <wubo.oduw@gmail.com>
To: fstests@vger.kernel.org
Cc: Zorro Lang <zlang@kernel.org>, Christoph Hellwig <hch@lst.de>,
Wu Bo <bo.wu@vivo.com>, Wu Bo <wubo.oduw@gmail.com>
Subject: [PATCH] check stx_dio_offset_align to determine if DIO is supported
Date: Mon, 23 Sep 2024 17:06:07 +0800 [thread overview]
Message-ID: <20240923090607.953579-1-wubo.oduw@gmail.com> (raw)
According to the statx manual, if stx_dio_offset_align is 0, it
indicates that Direct I/O (DIO) is not supported on this file.
Signed-off-by: Wu Bo <wubo.oduw@gmail.com>
---
src/min_dio_alignment.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/min_dio_alignment.c b/src/min_dio_alignment.c
index 131f6023..c50ae8c3 100644
--- a/src/min_dio_alignment.c
+++ b/src/min_dio_alignment.c
@@ -28,7 +28,7 @@ static int min_dio_alignment(const char *mntpnt, const char *devname)
fd = open(mntpnt, O_TMPFILE | O_RDWR | O_EXCL, 0600);
if (fd >= 0 &&
xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0 &&
- (stx.stx_mask & STATX_DIOALIGN))
+ (stx.stx_mask & STATX_DIOALIGN) && stx.stx_dio_offset_align)
return stx.stx_dio_offset_align;
/*
--
2.34.1
next reply other threads:[~2024-09-23 9:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-23 9:06 Wu Bo [this message]
2024-09-23 11:01 ` [PATCH] check stx_dio_offset_align to determine if DIO is supported Filipe Manana
2024-09-23 13:46 ` Zorro Lang
2024-10-07 12:14 ` Filipe Manana
2024-10-11 5:50 ` Zorro Lang
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=20240923090607.953579-1-wubo.oduw@gmail.com \
--to=wubo.oduw@gmail.com \
--cc=bo.wu@vivo.com \
--cc=fstests@vger.kernel.org \
--cc=hch@lst.de \
--cc=zlang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox