From: Konrad Rzeszutek Wilk Date: Mon, 10 Oct 2011 16:33:21 +0000 (-0400) Subject: xen/blkback: Report VBD_WSECT (wr_sect) properly. X-Git-Tag: firefly_0821_release~7541^2~2337 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9ad93ba528bf5555a96ef64b7ec1af398277ad52;p=firefly-linux-kernel-4.4.55.git xen/blkback: Report VBD_WSECT (wr_sect) properly. commit 5c62cb48602dba95159c81ffeca179d3852e25be upstream. We did not increment the amount of sectors written to disk b/c we tested for the == WRITE which is incorrect - as the operations are more of WRITE_FLUSH, WRITE_ODIRECT. This patch fixes it by doing a & WRITE check. Reported-by: Andy Burns Suggested-by: Ian Campbell Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index 5cf2993a8338..54139d0f5fec 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -667,7 +667,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, if (operation == READ) blkif->st_rd_sect += preq.nr_sects; - else if (operation == WRITE || operation == WRITE_FLUSH) + else if (operation & WRITE) blkif->st_wr_sect += preq.nr_sects; return 0;