Skip to content

Commit

Permalink
Prevent discard requests from going beyond the disk size (to be squas…
Browse files Browse the repository at this point in the history
…hed)

Signed-off-by: Robert Breker <[email protected]>
  • Loading branch information
Robert Breker committed Oct 7, 2015
1 parent 6d24d95 commit ef8c442
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/tapdisk-image.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ tapdisk_image_check_request(td_image_t *image, td_vbd_request_t *vreq)

switch (vreq->op) {
case TD_OP_DISCARD:
secs = vreq->discard_nr_sectors;
/* fall through */
case TD_OP_WRITE:
if (rdonly) {
Expand Down

0 comments on commit ef8c442

Please sign in to comment.