]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
io_uring: use better types for cflags
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 28 Feb 2021 22:35:15 +0000 (22:35 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jun 2021 11:39:23 +0000 (13:39 +0200)
[ Upstream commit 8c3f9cd1603d0e4af6c50ebc6d974ab7bdd03cf4 ]

__io_cqring_fill_event() takes cflags as long to squeeze it into u32 in
an CQE, awhile all users pass int or unsigned. Replace it with unsigned
int and store it as u32 in struct io_completion to match CQE.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/io_uring.c

index 958c463c11ebff3cd89f449b90fc5976a145dda5..fdbaaf579cc60a0b5b1b6381a48a715f1ef1e294 100644 (file)
@@ -545,7 +545,7 @@ struct io_statx {
 struct io_completion {
        struct file                     *file;
        struct list_head                list;
-       int                             cflags;
+       u32                             cflags;
 };
 
 struct io_async_connect {
@@ -1711,7 +1711,8 @@ static void io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force,
        }
 }
 
-static void __io_cqring_fill_event(struct io_kiocb *req, long res, long cflags)
+static void __io_cqring_fill_event(struct io_kiocb *req, long res,
+                                  unsigned int cflags)
 {
        struct io_ring_ctx *ctx = req->ctx;
        struct io_uring_cqe *cqe;