[rh7] ploop: Decrement active_reqs before bio_endio()

Submitted by Kirill Tkhai on June 24, 2019, 2:31 p.m.

Details

Message ID 156138669537.26109.11395671458904445849.stgit@localhost.localdomain
State New
Series "ploop: Decrement active_reqs before bio_endio()"
Headers show

Commit Message

Kirill Tkhai June 24, 2019, 2:31 p.m.
Otherwise, there are possible false possitive checks
for active_reqs on ploop stop.

https://jira.sw.ru/browse/PSBM-95654

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/block/ploop/dev.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 9d932d1b959f..10b4abc00592 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -636,8 +636,6 @@  DEFINE_BIO_CB(ploop_fast_end_io)
 
 	plo = orig->bi_bdev->bd_disk->private_data;
 
-	BIO_ENDIO(plo->queue, orig, err);
-
 	/* End of fast bio wakes up main process only when this could
 	 * mean exit from ATTENTION state.
 	 */
@@ -653,6 +651,8 @@  DEFINE_BIO_CB(ploop_fast_end_io)
 		wake_up_interruptible(&plo->waitq);
 	spin_unlock_irqrestore(&plo->lock, flags);
 
+	BIO_ENDIO(plo->queue, orig, err);
+
 	bio_put(bio);
 }
 END_BIO_CB(ploop_fast_end_io)