From: Greg Kroah-Hartman Date: Mon, 29 Aug 2022 08:01:48 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v5.10.140~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4c38e2f15eb7e8d179166cdc4bb526e8e7f7609e;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: io_uring-fix-issue-with-io_write-not-always-undoing-sb_start_write.patch --- diff --git a/queue-5.15/io_uring-fix-issue-with-io_write-not-always-undoing-sb_start_write.patch b/queue-5.15/io_uring-fix-issue-with-io_write-not-always-undoing-sb_start_write.patch new file mode 100644 index 00000000000..edf14e35a02 --- /dev/null +++ b/queue-5.15/io_uring-fix-issue-with-io_write-not-always-undoing-sb_start_write.patch @@ -0,0 +1,36 @@ +From foo@baz Mon Aug 29 10:00:25 AM CEST 2022 +From: Jens Axboe +Date: Thu, 25 Aug 2022 10:19:08 -0600 +Subject: io_uring: fix issue with io_write() not always undoing sb_start_write() + +From: Jens Axboe + +commit e053aaf4da56cbf0afb33a0fda4a62188e2c0637 upstream. + +This is actually an older issue, but we never used to hit the -EAGAIN +path before having done sb_start_write(). Make sure that we always call +kiocb_end_write() if we need to retry the write, so that we keep the +calls to sb_start_write() etc balanced. + +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + fs/io_uring.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/fs/io_uring.c ++++ b/fs/io_uring.c +@@ -3720,7 +3720,12 @@ done: + copy_iov: + iov_iter_restore(iter, state); + ret = io_setup_async_rw(req, iovec, inline_vecs, iter, false); +- return ret ?: -EAGAIN; ++ if (!ret) { ++ if (kiocb->ki_flags & IOCB_WRITE) ++ kiocb_end_write(req); ++ return -EAGAIN; ++ } ++ return ret; + } + out_free: + /* it's reportedly faster than delegating the null check to kfree() */ diff --git a/queue-5.15/series b/queue-5.15/series index 28188538c02..87fb8a39955 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -115,3 +115,4 @@ nouveau-explicitly-wait-on-the-fence-in-nouveau_bo_move_m2mf.patch smb3-missing-inode-locks-in-punch-hole.patch xen-privcmd-fix-error-exit-of-privcmd_ioctl_dm_op.patch riscv-traps-add-missing-prototype.patch +io_uring-fix-issue-with-io_write-not-always-undoing-sb_start_write.patch