[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 07/15] block: bdrv_check_perm(): process children anyway
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v6 07/15] block: bdrv_check_perm(): process children anyway |
Date: |
Fri, 18 Sep 2020 21:19:43 +0300 |
Do generic processing even for drivers which define .bdrv_check_perm
handler. It's needed for further preallocate filter: it will need to do
additional action on bdrv_check_perm, but don't want to reimplement
generic logic.
The patch doesn't change existing behaviour: the only driver that
implements bdrv_check_perm is file-posix, but it never has any
children.
Also, bdrv_set_perm() don't stop processing if driver has
.bdrv_set_perm handler as well.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
block.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/block.c b/block.c
index 9538af4884..165c2d3cb2 100644
--- a/block.c
+++ b/block.c
@@ -1964,8 +1964,7 @@ static void bdrv_child_perm(BlockDriverState *bs,
BlockDriverState *child_bs,
/*
* Check whether permissions on this node can be changed in a way that
* @cumulative_perms and @cumulative_shared_perms are the new cumulative
- * permissions of all its parents. This involves checking whether all necessary
- * permission changes to child nodes can be performed.
+ * permissions of all its parents.
*
* Will set *tighten_restrictions to true if and only if new permissions have
to
* be taken or currently shared permissions are to be unshared. Otherwise,
@@ -2047,8 +2046,11 @@ static int bdrv_check_perm(BlockDriverState *bs,
BlockReopenQueue *q,
}
if (drv->bdrv_check_perm) {
- return drv->bdrv_check_perm(bs, cumulative_perms,
- cumulative_shared_perms, errp);
+ ret = drv->bdrv_check_perm(bs, cumulative_perms,
+ cumulative_shared_perms, errp);
+ if (ret < 0) {
+ return ret;
+ }
}
/* Drivers that never have children can omit .bdrv_child_perm() */
--
2.21.3
- [PATCH v6 00/15] preallocate filter, Vladimir Sementsov-Ogievskiy, 2020/09/18
- [PATCH v6 01/15] block: simplify comment to BDRV_REQ_SERIALISING, Vladimir Sementsov-Ogievskiy, 2020/09/18
- [PATCH v6 02/15] block/io.c: drop assertion on double waiting for request serialisation, Vladimir Sementsov-Ogievskiy, 2020/09/18
- [PATCH v6 03/15] block/io: split out bdrv_find_conflicting_request, Vladimir Sementsov-Ogievskiy, 2020/09/18
- [PATCH v6 05/15] block: bdrv_mark_request_serialising: split non-waiting function, Vladimir Sementsov-Ogievskiy, 2020/09/18
- [PATCH v6 04/15] block/io: bdrv_wait_serialising_requests_locked: drop extra bs arg, Vladimir Sementsov-Ogievskiy, 2020/09/18
- [PATCH v6 06/15] block: introduce BDRV_REQ_NO_WAIT flag, Vladimir Sementsov-Ogievskiy, 2020/09/18
- [PATCH v6 07/15] block: bdrv_check_perm(): process children anyway,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v6 09/15] qemu-io: add preallocate mode parameter for truncate command, Vladimir Sementsov-Ogievskiy, 2020/09/18
- [PATCH v6 08/15] block: introduce preallocate filter, Vladimir Sementsov-Ogievskiy, 2020/09/18
- [PATCH v6 11/15] iotests: add 298 to test new preallocate filter driver, Vladimir Sementsov-Ogievskiy, 2020/09/18