io_uring: fix issue with io_write() not always undoing sb_start_write()
authorJens Axboe <axboe@kernel.dk>
Thu, 25 Aug 2022 16:19:08 +0000 (10:19 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2022 15:16:49 +0000 (17:16 +0200)
commit295219ab7d6250e56cba480cb8b46302401d9cce
tree2a65fbe04b59b58353309dc200527b08a5100244
parentf8aafb25ec38cf6f43cadb4c09ad2e577f48f349
io_uring: fix issue with io_write() not always undoing sb_start_write()

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 <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c