Skip to content

Commit

Permalink
xen/blkback: Fix the inhibition to map pages when discarding sector r…
Browse files Browse the repository at this point in the history
…anges.

The 'operation' parameters are the ones provided to the bio layer while
the req->operation are the ones passed in between the backend and
frontend. We used the wrong 'operation' value to squash the
call to map pages when processing the discard operation resulting
in an hypercall that did nothing. Lets guard against going in the
mapping function by checking for the proper operation type.

CC: Li Dongyang <lidongyang@novell.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Konrad Rzeszutek Wilk committed Oct 13, 2011
1 parent 5c62cb4 commit 64391b2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/block/xen-blkback/blkback.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
* the hypercall to unmap the grants - that is all done in
* xen_blkbk_unmap.
*/
if (operation != BLKIF_OP_DISCARD &&
xen_blkbk_map(req, pending_req, seg))
if (operation == REQ_DISCARD && xen_blkbk_map(req, pending_req, seg))
goto fail_flush;

/*
Expand Down

0 comments on commit 64391b2

Please sign in to comment.