public inbox for [email protected]
 help / color / mirror / Atom feed
From: Hao Xu <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, Pavel Begunkov <[email protected]>
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: <[email protected]> (raw)
In-Reply-To: <[email protected]>

From: Hao Xu <[email protected]>

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 <[email protected]>
---
 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


  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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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