Skip to content

Commit

Permalink
Revert "block/io: Comment out permission assertions"
Browse files Browse the repository at this point in the history
This reverts commit e3e0003.

This commit was necessary for the 2.9 release because we were unable to
fix the underlying issue(s) in time. However, we will be for 2.10.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Acked-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
XanClic authored and kevmw committed Apr 27, 2017
1 parent 0d5e0bb commit 362b378
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
6 changes: 1 addition & 5 deletions block.c
Expand Up @@ -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;
Expand Down
12 changes: 2 additions & 10 deletions block/io.c
Expand Up @@ -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);

Expand Down

0 comments on commit 362b378

Please sign in to comment.