[PATCH 1/3] fsstress: check io_uring_queue_init errno properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As the manual of io_uring_queue_init says "io_uring_queue_init(3)
returns 0 on success and -errno on failure". We should check if the
return value is -ENOSYS, not the errno.

Fixes: d15b1721f284 ("ltp/fsstress: don't fail on io_uring ENOSYS")
Signed-off-by: Zorro Lang <zlang@xxxxxxxxxx>
---
 ltp/fsstress.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index 63c75767..482395c4 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -763,8 +763,8 @@ int main(int argc, char **argv)
 #ifdef URING
 			have_io_uring = true;
 			/* If ENOSYS, just ignore uring, other errors are fatal. */
-			if (io_uring_queue_init(URING_ENTRIES, &ring, 0)) {
-				if (errno == ENOSYS) {
+			if ((c = io_uring_queue_init(URING_ENTRIES, &ring, 0)) != 0) {
+				if (c == -ENOSYS) {
 					have_io_uring = false;
 				} else {
 					fprintf(stderr, "io_uring_queue_init failed\n");
-- 
2.43.0





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux