Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 251269
b: refs/heads/master
c: 8ab5215
h: refs/heads/master
i:
  251267: d28a53a
v: v3
  • Loading branch information
Jan Beulich authored and Konrad Rzeszutek Wilk committed May 18, 2011
1 parent 7a1ccd8 commit 39fe1a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 496b318eb65558c1a3a4fe882cb9da6d1dc6493a
refs/heads/master: 8ab521506c4dbb144f0c04c55e3d8bec42c1b2b9
15 changes: 8 additions & 7 deletions trunk/drivers/block/xen-blkback/blkback.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,14 @@ static int xen_vbd_translate(struct phys_req *req, struct xen_blkif *blkif,
if ((operation != READ) && vbd->readonly)
goto out;

if (unlikely((req->sector_number + req->nr_sects) > vbd_sz(vbd)))
goto out;
if (likely(req->nr_sects)) {
blkif_sector_t end = req->sector_number + req->nr_sects;

if (unlikely(end < req->sector_number))
goto out;
if (unlikely(end > vbd_sz(vbd)))
goto out;
}

req->dev = vbd->pdevice;
req->bdev = vbd->bdev;
Expand Down Expand Up @@ -538,11 +544,6 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
case BLKIF_OP_FLUSH_DISKCACHE:
blkif->st_f_req++;
operation = WRITE_FLUSH;
/*
* The frontend likes to set this to -1, which xen_vbd_translate
* is alergic too.
*/
req->u.rw.sector_number = 0;
break;
case BLKIF_OP_WRITE_BARRIER:
default:
Expand Down

0 comments on commit 39fe1a7

Please sign in to comment.