check stx_dio_offset_align to determine if DIO is supported
PATCH 1/1 check stx_dio_offset_align to determine if DIO is supported
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.
--- src/min_dio_alignment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/min_dio_alignment.c +1 -1
@@ -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;/*
Signature · 1 line
2.34.1
Quoted 3 lines · Wu Bo
According to the statx manual, if
stx_dio_offset_alignis 0, it indicates that Direct I/O (DIO) is not supported on this file.
There's already a patch for this:
https://lore.kernel.org/fstests/[email protected]/
(but not merged yet)
Thanks.
Quoted 23 lines
Signed-off-by Wu Bo <[email protected]>--- src/min_dio_alignment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/min_dio_alignment.c +1
-2@@ -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
Quoted 10 lines · Filipe Manana
Quoted 3 lines · Wu Bo
According to the statx manual, if
stx_dio_offset_alignis 0, it indicates that Direct I/O (DIO) is not supported on this file.There's already a patch for this:
https://lore.kernel.org/fstests/[email protected]/
(but not merged yet)
Thanks Filipe. Yes, this's fixed by Chao Yu. You can check it in "patches-in-queue" branch, it'll be merged to for-next soon (this week I hope).
Thanks,
Zorro
Quoted 27 lines
Thanks.
Quoted 23 lines
Signed-off-by Wu Bo <[email protected]>--- src/min_dio_alignment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/min_dio_alignment.c +1
-2@@ -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
Quoted 9 lines · Zorro Lang
Quoted 7 lines · Filipe Manana
Quoted 3 lines · Wu Bo
According to the statx manual, if
stx_dio_offset_alignis 0, it indicates that Direct I/O (DIO) is not supported on this file.There's already a patch for this:
Quoted 7 lines
Quoted 3 lines
https://lore.kernel.org/fstests/[email protected]/
(but not merged yet)
Thanks Filipe. Yes, this's fixed by Chao Yu. You can check it in "patches-in-queue" branch, it'll be merged to for-next soon (this week I hope).
It missed the last update and it's still not in the "patches-in-queue" branch.
Thanks.
Quoted 32 lines
Thanks,
ZorroQuoted 27 lines
Thanks.
Quoted 23 lines
Signed-off-by Wu Bo <[email protected]>--- src/min_dio_alignment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/min_dio_alignment.c +1
-2@@ -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
Quoted 12 lines · Filipe Manana
Quoted 11 lines · Zorro Lang
Quoted 9 lines · Filipe Manana
Quoted 3 lines · Wu Bo
According to the statx manual, if
stx_dio_offset_alignis 0, it indicates that Direct I/O (DIO) is not supported on this file.There's already a patch for this:
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
(but not merged yet)
Thanks Filipe. Yes, this's fixed by Chao Yu. You can check it in "patches-in-queue" branch, it'll be merged to for-next soon (this week I hope).
It missed the last update and it's still not in the "patches-in-queue" branch.
Yes, sorry I missed that patch, my bad. It'll be in the release of this weekend, I'm sure about that :)
Quoted 36 lines
Thanks.
Quoted 32 lines
Thanks,
ZorroQuoted 27 lines
Thanks.
Quoted 23 lines
Signed-off-by Wu Bo <[email protected]>--- src/min_dio_alignment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/min_dio_alignment.c +1
-2@@ -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