diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2021-09-11 15:00:27 +0300 |
---|---|---|
committer | Hanna Reitz <hreitz@redhat.com> | 2021-09-15 15:54:07 +0200 |
commit | a13de40a05478e64726dd9861135d344837f3c30 (patch) | |
tree | 9472d3026cffb723b7f8668f337fd09e21a59ab3 /tests | |
parent | 2f43482733352e4423fcbddadd09265de92ddf58 (diff) | |
download | qemu-a13de40a05478e64726dd9861135d344837f3c30.zip qemu-a13de40a05478e64726dd9861135d344837f3c30.tar.gz qemu-a13de40a05478e64726dd9861135d344837f3c30.tar.bz2 |
block: bdrv_inactivate_recurse(): check for permissions and fix crash
We must not inactivate child when parent has write permissions on
it.
Calling .bdrv_inactivate() doesn't help: actually only qcow2 has this
handler and it is used to flush caches, not for permission
manipulations.
So, let's simply check cumulative parent permissions before
inactivating the node.
This commit fixes a crash when we do migration during backup: prior to
the commit nothing prevents all nodes inactivation at migration finish
and following backup write to the target crashes on assertion
"assert(!(bs->open_flags & BDRV_O_INACTIVE));" in
bdrv_co_write_req_prepare().
After the commit, we rely on the fact that copy-before-write filter
keeps write permission on target node to be able to write to it. So
inactivation fails and migration fails as expected.
Corresponding test now passes, so, enable it.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20210911120027.8063-3-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/qemu-iotests/tests/migrate-during-backup | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/qemu-iotests/tests/migrate-during-backup b/tests/qemu-iotests/tests/migrate-during-backup index 1046904..3410322 100755 --- a/tests/qemu-iotests/tests/migrate-during-backup +++ b/tests/qemu-iotests/tests/migrate-during-backup @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# group: migration disabled +# group: migration # # Copyright (c) 2021 Virtuozzo International GmbH # |