[Devel] [PATCH RHEL7 COMMIT] ploop: fix counting bio_qlen

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jun 17 02:32:34 PDT 2016


The commit is pushed to "branch-rh7-3.10.0-327.18.2.vz7.14.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.18.2.vz7.14.15
------>
commit 6cf1b457fb7252f4d2ada14f8cff0d3b91c26b5d
Author: Maxim Patlasov <mpatlasov at virtuozzo.com>
Date:   Fri Jun 17 13:32:34 2016 +0400

    ploop: fix counting bio_qlen
    
    The commit ec1eeb868 (May 22 2015) ported "separate queue for discard bio"
    patch from RHEL6-based kernel incorrectly. Original patch stated clearly
    that if we want to decrement bio_discard_qlen, bio_qlen must not change:
    
    @@ -500,7 +502,7 @@ ploop_bio_queue(struct ploop_device * pl
                        (err = ploop_discard_add_bio(plo->fbd, bio))) {
                            BIO_ENDIO(bio, err);
                            list_add(&preq->list, &plo->free_list);
    -                       plo->bio_qlen--;
    +                       plo->bio_discard_qlen--;
                            plo->bio_total--;
                            return;
                    }
    
    but that port did the opposite:
    
    @@ -521,6 +523,7 @@ ploop_bio_queue(struct ploop_device * plo, struct bio * bio,
                            BIO_ENDIO(plo->queue, bio, err);
                            list_add(&preq->list, &plo->free_list);
                            plo->bio_qlen--;
    +                       plo->bio_discard_qlen--;
                            plo->bio_total--;
                            return;
                    }
    
    Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
    Acked-by: Dmitry Monakhov <dmonakhov at virtuozzo.com>
---
 drivers/block/ploop/dev.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 01a5189..2ef1449 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -530,7 +530,6 @@ ploop_bio_queue(struct ploop_device * plo, struct bio * bio,
 			}
 			BIO_ENDIO(plo->queue, bio, err);
 			list_add(&preq->list, &plo->free_list);
-			plo->bio_qlen--;
 			plo->bio_discard_qlen--;
 			plo->bio_total--;
 			return;


More information about the Devel mailing list