[RHEL7,COMMIT] ploop: Fix discard BIOs mis accounting

Submitted by Konstantin Khorenko on Feb. 1, 2019, 1:42 p.m.

Details

Message ID 201902011342.x11Dg0FE012811@finist-ce7.sw.ru
State New
Series "ploop: Fix discard BIOs mis accounting"
Headers show

Commit Message

Konstantin Khorenko Feb. 1, 2019, 1:42 p.m.
The commit is pushed to "branch-rh7-3.10.0-957.1.3.vz7.83.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.1.3.vz7.83.9
------>
commit 8e258a43fdd55019dc594388d328ead2f9b687a6
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Fri Feb 1 16:42:00 2019 +0300

    ploop: Fix discard BIOs mis accounting
    
    Discard requests submitted in non-maintaince mode
    never decremented. So, their number grows endlessly
    in file:
    
      $cat /sys/block/ploopXXX/pstate/discard_bios
    
    Fix that.
    
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/block/ploop/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index a82988c1f538..c398026ff602 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -593,7 +593,7 @@  ploop_bio_queue(struct ploop_device * plo, struct bio * bio,
 
 	__TRACE("A %p %u\n", preq, preq->req_cluster);
 
-	if (unlikely(preq->state & (1 << PLOOP_REQ_DISCARD)))
+	if (unlikely(bio->bi_rw & REQ_DISCARD))
 		plo->bio_discard_qlen--;
 	else
 		plo->bio_qlen--;