From: Hao Xu <hao.xu@linux.dev>
To: io-uring@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>, Pavel Begunkov <asml.silence@gmail.com>
Subject: [PATCH 2/3] test/accept: fix minus one error when calculating multishot_mask
Date: Fri, 17 Jun 2022 22:36:02 +0800 [thread overview]
Message-ID: <20220617143603.179277-3-hao.xu@linux.dev> (raw)
In-Reply-To: <20220617143603.179277-1-hao.xu@linux.dev>
From: Hao Xu <howeyxu@tencent.com>
We don't need to minus one for the s_fd[i] since the returned cqe.res
is already the fixed file table slot which is indexed from zero.
Fixes: 66cf84527c34 ("test/accept.c: add test for multishot mode accept")
Signed-off-by: Hao Xu <howeyxu@tencent.com>
---
test/accept.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/accept.c b/test/accept.c
index c6654baa3925..b322c018c7a9 100644
--- a/test/accept.c
+++ b/test/accept.c
@@ -241,7 +241,7 @@ static int test_loop(struct io_uring *ring,
i, s_fd[i]);
goto err;
}
- multishot_mask |= (1 << (s_fd[i] - 1));
+ multishot_mask |= (1U << s_fd[i]);
}
if (!multishot)
break;
--
2.25.1
next prev parent reply other threads:[~2022-06-17 14:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-17 14:36 [PATCH liburing 0/3] multishot accept test fix and clean Hao Xu
2022-06-17 14:36 ` [PATCH 1/3] Fix incorrect close in test for multishot accept Hao Xu
2022-06-17 14:36 ` Hao Xu [this message]
2022-06-17 14:36 ` [PATCH 3/3] test/accept: clean code of accept test Hao Xu
2022-06-17 14:41 ` [PATCH liburing 0/3] multishot accept test fix and clean Hao Xu
2022-06-17 14:42 ` Jens Axboe
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=20220617143603.179277-3-hao.xu@linux.dev \
--to=hao.xu@linux.dev \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=io-uring@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.