[Devel] [vzlin-dev] [PATCH rh7] ploop: fix counting bio_qlen

Dmitry Monakhov dmonakhov at openvz.org
Fri Jun 17 01:46:42 PDT 2016


Maxim Patlasov <mpatlasov at virtuozzo.com> writes:

> 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>
> ---
>  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 db55be3..e1fbfcf 100644
> --- a/drivers/block/ploop/dev.c
> +++ b/drivers/block/ploop/dev.c
> @@ -523,7 +523,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;
ACK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/devel/attachments/20160617/bccb8d85/attachment-0001.sig>


More information about the Devel mailing list