Skip to content

Commit

Permalink
xen/blkback: Report VBD_WSECT (wr_sect) properly.
Browse files Browse the repository at this point in the history
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 <xen.lists@burns.me.uk>
Suggested-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Konrad Rzeszutek Wilk committed Oct 13, 2011
1 parent 29bde09 commit 5c62cb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/xen-blkback/blkback.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,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;
Expand Down

0 comments on commit 5c62cb4

Please sign in to comment.