[Devel] [PATCH] ploop: don't forget to dec preq->io_count on a error path

Andrei Vagin avagin at openvz.org
Thu Feb 15 04:27:13 MSK 2018


[This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing]

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.
---
 drivers/block/ploop/io_kaio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/ploop/io_kaio.c b/drivers/block/ploop/io_kaio.c
index 2e48d13..6d922f5 100644
--- a/drivers/block/ploop/io_kaio.c
+++ b/drivers/block/ploop/io_kaio.c
@@ -686,6 +686,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);
        }

 out:
--
1.8.3.1




More information about the Devel mailing list