diff mbox series

[for-next] io_uring: fix ctx refcounting in io_uring_enter()

Message ID 20200909151900.60321-1-sgarzare@redhat.com (mailing list archive)
State New, archived
Headers show
Series [for-next] io_uring: fix ctx refcounting in io_uring_enter() | expand

Commit Message

Stefano Garzarella Sept. 9, 2020, 3:19 p.m. UTC
If the ring is disabled we don't decrease the 'ctx' refcount since
we wrongly jump to 'out_fput' label.

Instead let's jump to 'out' label where we decrease the 'ctx' refcount.

Fixes: 7ec3d1dd9378 ("io_uring: allow disabling rings during the creation")
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jens Axboe Sept. 9, 2020, 6:30 p.m. UTC | #1
On 9/9/20 9:19 AM, Stefano Garzarella wrote:
> If the ring is disabled we don't decrease the 'ctx' refcount since
> we wrongly jump to 'out_fput' label.
> 
> Instead let's jump to 'out' label where we decrease the 'ctx' refcount.

Applied, thanks.
diff mbox series

Patch

diff --git a/fs/io_uring.c b/fs/io_uring.c
index bd1ac8581d38..8fc44967fd52 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8645,7 +8645,7 @@  SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
 
 	ret = -EBADFD;
 	if (ctx->flags & IORING_SETUP_R_DISABLED)
-		goto out_fput;
+		goto out;
 
 	/*
 	 * For SQ polling, the thread will do all submissions and completions.