aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2016-12-06 17:35:29 +0000
committerStefan Hajnoczi <stefanha@redhat.com>2016-12-06 17:35:29 +0000
commit68701de1362b29fd6941a2021e9393ddbe60edd8 (patch)
tree8fc7c1dbddc834db8f4d58f91408fbc0fb0fa4ad /block
parentce1f3e88f8338cff5bac3b1d1289f8f2260c7247 (diff)
parenta3e1505daec31ef56f0489f8c8fff1b8e4ca92bd (diff)
Merge remote-tracking branch 'kwolf/tags/for-upstream' into staging
Block layer patches for 2.8.0-rc3 # gpg: Signature made Tue 06 Dec 2016 02:44:39 PM GMT # gpg: using RSA key 0x7F09B272C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * kwolf/tags/for-upstream: qcow2: Don't strand clusters near 2G intervals during commit Message-id: 1481037418-10239-1-git-send-email-kwolf@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/qcow2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index ed9e0f31d6..96fb8a8f16 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2808,7 +2808,8 @@ static int qcow2_make_empty(BlockDriverState *bs)
{
BDRVQcow2State *s = bs->opaque;
uint64_t start_sector;
- int sector_step = INT_MAX / BDRV_SECTOR_SIZE;
+ int sector_step = (QEMU_ALIGN_DOWN(INT_MAX, s->cluster_size) /
+ BDRV_SECTOR_SIZE);
int l1_clusters, ret = 0;
l1_clusters = DIV_ROUND_UP(s->l1_size, s->cluster_size / sizeof(uint64_t));