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: next-20111012~16^2^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=680585607504bc82e7788250a490f1a091742d8d;p=karo-tx-linux.git xen/blkback: Report VBD_WSECT (wr_sect) properly. 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. CC: stable@kernel.org Reported-by: Andy Burns Signed-off-by: Konrad Rzeszutek Wilk --- diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index e0dab614049c..5cdf57e685fd 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -743,7 +743,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;