Commit 690a2c64 authored by Konrad Rzeszutek Wilk's avatar Konrad Rzeszutek Wilk Committed by Greg Kroah-Hartman

xen/blkback: Report VBD_WSECT (wr_sect) properly.

commit 5c62cb48 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: default avatarAndy Burns <xen.lists@burns.me.uk>
Suggested-by: default avatarIan Campbell <Ian.Campbell@citrix.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6022736e
...@@ -685,7 +685,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, ...@@ -685,7 +685,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
if (operation == READ) if (operation == READ)
blkif->st_rd_sect += preq.nr_sects; 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; blkif->st_wr_sect += preq.nr_sects;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment