[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 04/34] Revert "block/io: Comment out permission asser
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 04/34] Revert "block/io: Comment out permission assertions" |
Date: |
Fri, 28 Apr 2017 22:33:12 +0200 |
From: Max Reitz <address@hidden>
This reverts commit e3e0003a8f6570aba1421ef99a0b383a43371a74.
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 <address@hidden>
Acked-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 6 +-----
block/io.c | 12 ++----------
2 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/block.c b/block.c
index 5db266b..ceaca44 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 a7142e0..a32fd1d 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);
--
1.8.3.1
- [Qemu-block] [PULL 00/34] Block layer patches, Kevin Wolf, 2017/04/28
- [Qemu-block] [PULL 02/34] file-posix: Remove unnecessary includes, Kevin Wolf, 2017/04/28
- [Qemu-block] [PULL 01/34] block: Constify data passed by pointer to blk_name, Kevin Wolf, 2017/04/28
- [Qemu-block] [PULL 03/34] file-win32: Remove unnecessary include, Kevin Wolf, 2017/04/28
- [Qemu-block] [PULL 04/34] Revert "block/io: Comment out permission assertions",
Kevin Wolf <=
- [Qemu-block] [PULL 06/34] migration: Call blk_resume_after_migration() for postcopy, Kevin Wolf, 2017/04/28
- [Qemu-block] [PULL 05/34] qemu-img: simplify img_convert, Kevin Wolf, 2017/04/28
- [Qemu-block] [PULL 08/34] qemu-iotests: Test postcopy migration, Kevin Wolf, 2017/04/28
- [Qemu-block] [PULL 09/34] block: An empty filename counts as no filename, Kevin Wolf, 2017/04/28
- [Qemu-block] [PULL 10/34] iotests/051: Add test for empty filename, Kevin Wolf, 2017/04/28
- [Qemu-block] [PULL 11/34] qemu-iotests: Remove PERL_PROG and BC_PROG, Kevin Wolf, 2017/04/28
- [Qemu-block] [PULL 12/34] qemu_iotests: Remove _readlink(), Kevin Wolf, 2017/04/28
- [Qemu-block] [PULL 13/34] block: Remove NULL check in bdrv_co_flush, Kevin Wolf, 2017/04/28
- [Qemu-block] [PULL 14/34] iotests: Launch qemu-nbd with -e 42, Kevin Wolf, 2017/04/28