aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xen-blkback
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-10-10 00:47:49 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-10-13 09:48:38 -0400
commit64391b2536ca92f9c589b2bfeaca3954896fe057 (patch)
tree0712fab29f774ec1bf6e4bb851cf58228486af1d /drivers/block/xen-blkback
parent5c62cb48602dba95159c81ffeca179d3852e25be (diff)
xen/blkback: Fix the inhibition to map pages when discarding sector ranges.
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>
Diffstat (limited to 'drivers/block/xen-blkback')
-rw-r--r--drivers/block/xen-blkback/blkback.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index c15c559e866..53c81de6f88 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -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;
/*