Skip to content

Commit dd461af

Browse files
Bijan Mottahedehaxboe
authored andcommitted
io_uring: use proper references for fallback_req locking
Use ctx->fallback_req address for test_and_set_bit_lock() and clear_bit_unlock(). Signed-off-by: Bijan Mottahedeh <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 490e896 commit dd461af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/io_uring.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ static struct io_kiocb *io_get_fallback_req(struct io_ring_ctx *ctx)
12951295
struct io_kiocb *req;
12961296

12971297
req = ctx->fallback_req;
1298-
if (!test_and_set_bit_lock(0, (unsigned long *) ctx->fallback_req))
1298+
if (!test_and_set_bit_lock(0, (unsigned long *) &ctx->fallback_req))
12991299
return req;
13001300

13011301
return NULL;
@@ -1382,7 +1382,7 @@ static void __io_free_req(struct io_kiocb *req)
13821382
if (likely(!io_is_fallback_req(req)))
13831383
kmem_cache_free(req_cachep, req);
13841384
else
1385-
clear_bit_unlock(0, (unsigned long *) req->ctx->fallback_req);
1385+
clear_bit_unlock(0, (unsigned long *) &req->ctx->fallback_req);
13861386
}
13871387

13881388
struct req_batch {

0 commit comments

Comments
 (0)