From: Jens Axboe <axboe@kernel.dk>
To: io-uring@vger.kernel.org
Cc: jlayton@kernel.org, Jens Axboe <axboe@kernel.dk>
Subject: [PATCH 1/4] io_uring: add end-of-bits marker and build time verify it
Date: Tue, 3 Mar 2020 16:50:50 -0700 [thread overview]
Message-ID: <20200303235053.16309-2-axboe@kernel.dk> (raw)
In-Reply-To: <20200303235053.16309-1-axboe@kernel.dk>
Not easy to tell if we're going over the size of bits we can shove
in req->flags, so add an end-of-bits marker and a BUILD_BUG_ON()
check for it.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
fs/io_uring.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 3df54dad9eae..0464efbeba25 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -511,6 +511,9 @@ enum {
REQ_F_OVERFLOW_BIT,
REQ_F_POLLED_BIT,
REQ_F_BUFFER_SELECTED_BIT,
+
+ /* not a real bit, just to check we're not overflowing the space */
+ __REQ_F_LAST_BIT,
};
enum {
@@ -8011,6 +8014,7 @@ static int __init io_uring_init(void)
BUILD_BUG_SQE_ELEM(44, __s32, splice_fd_in);
BUILD_BUG_ON(ARRAY_SIZE(io_op_defs) != IORING_OP_LAST);
+ BUILD_BUG_ON(__REQ_F_LAST_BIT >= 8 * sizeof(int));
req_cachep = KMEM_CACHE(io_kiocb, SLAB_HWCACHE_ALIGN | SLAB_PANIC);
return 0;
};
--
2.25.1
next prev parent reply other threads:[~2020-03-03 23:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-03 23:50 [PATCHSET RFC 0/4] Support passing fds between chain links Jens Axboe
2020-03-03 23:50 ` Jens Axboe [this message]
2020-03-03 23:50 ` [PATCH 2/4] io_uring: move CLOSE req->file checking into handler Jens Axboe
2020-03-04 13:07 ` Pavel Begunkov
2020-03-04 17:47 ` Jens Axboe
2020-03-03 23:50 ` [PATCH 3/4] io_uring: move read/write side file based prep into op handler Jens Axboe
2020-03-03 23:50 ` [PATCH 4/4] io_uring: test patch for fd passing Jens Axboe
2020-03-04 13:13 ` Pavel Begunkov
2020-03-04 17:48 ` Jens Axboe
2020-03-04 0:43 ` [PATCHSET RFC 0/4] Support passing fds between chain links Jeff Layton
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=20200303235053.16309-2-axboe@kernel.dk \
--to=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=jlayton@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.