[RHEL7,COMMIT] ploop: don't forget to dec preq->io_count on a error path

Submitted by Konstantin Khorenko on Feb. 15, 2018, 11:27 a.m.


Message ID 201802151127.w1FBRDx4000776@finist_ce7.work
State New
Series "ploop: don't forget to dec preq->io_count on a error path"
Headers show

Commit Message

Konstantin Khorenko Feb. 15, 2018, 11:27 a.m.
The commit is pushed to "branch-rh7-3.10.0-693.17.1.vz7.43.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.17.1.vz7.43.5
commit 2286b24cd2ec192ad864fca6a1681944be495fcd
Author: Andrei Vagin <avagin@openvz.org>
Date:   Thu Feb 15 14:27:13 2018 +0300

    ploop: don't forget to dec preq->io_count on a error path
    preq->io_count is incrimented before calling aio_kernel_submit()
    and it is decrimented in kaio_rw_aio_complete().
    But if aio_kernel_submit() failed , preq->io_count has to be decrimented
    before exiting from the function.
    Signed-off-by: Andrei Vagin <avagin@openvz.org>
 drivers/block/ploop/io_kaio.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/io_kaio.c b/drivers/block/ploop/io_kaio.c
index ee9ba2664d72..c7f3bc93bf57 100644
--- a/drivers/block/ploop/io_kaio.c
+++ b/drivers/block/ploop/io_kaio.c
@@ -601,6 +601,7 @@  kaio_io_page(struct ploop_io * io, int op, struct ploop_request * preq,
 		       err, (op == IOCB_CMD_WRITE_ITER) ? "WRITE" : "READ",
 		       preq->eng_state, preq->state, pos);
 		PLOOP_REQ_SET_ERROR(preq, err);
+		ploop_complete_io_request(preq);