summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-10-10 12:33:21 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-11 09:37:07 -0800
commit9ad93ba528bf5555a96ef64b7ec1af398277ad52 (patch)
treefab33a1ec9da605fe2ee1541da5dbda51908063c /drivers/block
parentf53881e6463124c910b17a5ea722a5cf5ab67fb3 (diff)
downloadlwn-9ad93ba528bf5555a96ef64b7ec1af398277ad52.tar.gz
lwn-9ad93ba528bf5555a96ef64b7ec1af398277ad52.zip
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 <xen.lists@burns.me.uk> Suggested-by: Ian Campbell <Ian.Campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/xen-blkback/blkback.c2
1 files changed, 1 insertions, 1 deletions
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;