diff --git a/block.c b/block.c index 5db266be2103a1c6db107600f26afd39abd05a08..ceaca44975eaf660ccd82cb0201a02316a23197e 100644 --- a/block.c +++ b/block.c @@ -3313,11 +3313,7 @@ int bdrv_truncate(BdrvChild *child, int64_t offset) BlockDriver *drv = bs->drv; int ret; - /* FIXME: Some format block drivers use this function instead of implicitly - * growing their file by writing beyond its end. - * See bdrv_aligned_pwritev() for an explanation why we currently - * cannot assert this permission in that case. */ - // assert(child->perm & BLK_PERM_RESIZE); + assert(child->perm & BLK_PERM_RESIZE); if (!drv) return -ENOMEDIUM; diff --git a/block/io.c b/block/io.c index a7142e00e833fcb6f752c32b9bbd3f0a26956e89..a32fd1d9e59248a741db5ae97df74d55fa0a9d61 100644 --- a/block/io.c +++ b/block/io.c @@ -1362,16 +1362,8 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child, assert(!waited || !req->serialising); assert(req->overlap_offset <= offset); assert(offset + bytes <= req->overlap_offset + req->overlap_bytes); - /* FIXME: Block migration uses the BlockBackend of the guest device at a - * point when it has not yet taken write permissions. This will be - * fixed by a future patch, but for now we have to bypass this - * assertion for block migration to work. */ - // assert(child->perm & BLK_PERM_WRITE); - /* FIXME: Because of the above, we also cannot guarantee that all format - * BDS take the BLK_PERM_RESIZE permission on their file BDS, since - * they are not obligated to do so if they do not have any parent - * that has taken the permission to write to them. */ - // assert(end_sector <= bs->total_sectors || child->perm & BLK_PERM_RESIZE); + assert(child->perm & BLK_PERM_WRITE); + assert(end_sector <= bs->total_sectors || child->perm & BLK_PERM_RESIZE); ret = notifier_with_return_list_notify(&bs->before_write_notifiers, req);