summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-03-22 04:45:59 +0300
committerJens Axboe <axboe@kernel.dk>2021-03-22 16:40:14 +0300
commitb65c128f963df367a8adcfb08f5ecf8721052723 (patch)
treeda76654c20d63c3f21e96bf5b14311cc561893af /fs/io_uring.c
parentd07f1e8a42614cc938c9c88866d4474a5a7fee31 (diff)
downloadlinux-b65c128f963df367a8adcfb08f5ecf8721052723.tar.xz
io_uring: don't skip file_end_write() on reissue
Don't miss to call kiocb_end_write() from __io_complete_rw() on reissue. Shouldn't be much of a problem as the function actually does some work only for ISREG, and NONBLOCK won't be reissued. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/32af9b77c5b874e1bee1a3c46396094bd969e577.1616366969.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 50acd6dfd966..a664b44a5a94 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2524,13 +2524,12 @@ static void __io_complete_rw(struct io_kiocb *req, long res, long res2,
{
int cflags = 0;
+ if (req->rw.kiocb.ki_flags & IOCB_WRITE)
+ kiocb_end_write(req);
if ((res == -EAGAIN || res == -EOPNOTSUPP) && io_rw_reissue(req))
return;
if (res != req->result)
req_set_fail_links(req);
-
- if (req->rw.kiocb.ki_flags & IOCB_WRITE)
- kiocb_end_write(req);
if (req->flags & REQ_F_BUFFER_SELECTED)
cflags = io_put_rw_kbuf(req);
__io_req_complete(req, issue_flags, res, cflags);