]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
xen/blkback: Report VBD_WSECT (wr_sect) properly.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 10 Oct 2011 16:33:21 +0000 (12:33 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Nov 2011 17:37:07 +0000 (09:37 -0800)
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>
drivers/block/xen-blkback/blkback.c

index 5cf2993a8338c9e325fb6126d5a6ec3ca371f6e3..54139d0f5fec2ea110155d98baa4db2b162c08c2 100644 (file)
@@ -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;