aboutsummaryrefslogtreecommitdiffstats
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-12-14 20:57:27 -0700
committerJens Axboe <axboe@kernel.dk>2020-12-16 14:56:36 -0700
commita146468d76e0462393a3e15b77b8b3ede60e2d06 (patch)
tree3de5bba9905e028f6f8c004562eb93879fc90aae /fs/io_uring.c
parentMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma (diff)
downloadlinux-dev-a146468d76e0462393a3e15b77b8b3ede60e2d06.tar.xz
linux-dev-a146468d76e0462393a3e15b77b8b3ede60e2d06.zip
io_uring: break links on shutdown failure
Ensure that the return value of __sys_shutdown_sock() is used to potentially break links to the request, if we fail. Fixes: 36f4fa6886a8 ("io_uring: add support for shutdown(2)") Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 6f9392c35eef..6a4560c9ed9a 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3784,6 +3784,8 @@ static int io_shutdown(struct io_kiocb *req, bool force_nonblock)
return -ENOTSOCK;
ret = __sys_shutdown_sock(sock, req->shutdown.how);
+ if (ret < 0)
+ req_set_fail_links(req);
io_req_complete(req, ret);
return 0;
#else