aboutsummaryrefslogtreecommitdiff
path: root/block/io.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2016-06-16 19:09:39 +0300
committerStefan Hajnoczi <stefanha@redhat.com>2016-06-20 11:44:12 +0100
commit3a36e474f2ca74ebd4f36044823a625389dfef01 (patch)
tree5239d6a8e018b644090a8682b16bf0923bcc2e80 /block/io.c
parentf1d3b99154138741161fc52f5a8c373bf71613c6 (diff)
block: fixed BdrvTrackedRequest filling in bdrv_co_discard
The request area is specified in bytes, not in sectors. Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Vladimir Sementsov-Ogievskiy<vsementsov@virtuozzo.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1466093381-6120-2-git-send-email-den@openvz.org CC: Stefan Hajnoczi <stefanha@redhat.com> CC: Kevin Wolf <kwolf@redhat.com> CC: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/io.c')
-rw-r--r--block/io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/io.c b/block/io.c
index ebdb9d834c..3527d91aa0 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2347,8 +2347,8 @@ int coroutine_fn bdrv_co_discard(BlockDriverState *bs, int64_t sector_num,
return 0;
}
- tracked_request_begin(&req, bs, sector_num, nb_sectors,
- BDRV_TRACKED_DISCARD);
+ tracked_request_begin(&req, bs, sector_num << BDRV_SECTOR_BITS,
+ nb_sectors << BDRV_SECTOR_BITS, BDRV_TRACKED_DISCARD);
bdrv_set_dirty(bs, sector_num, nb_sectors);
max_discard = MIN_NON_ZERO(bs->bl.max_discard, BDRV_REQUEST_MAX_SECTORS);