[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/30] block: bdrv_check_perm(): process children anyway
From: |
Max Reitz |
Subject: |
[PULL 11/30] block: bdrv_check_perm(): process children anyway |
Date: |
Fri, 18 Dec 2020 16:12:30 +0100 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
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>
Message-Id: <20201021145859.11201-8-vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
block.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index b57421a969..64412ee7de 100644
--- a/block.c
+++ b/block.c
@@ -2028,8 +2028,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.29.2
- [PULL 02/30] block: bdrv_set_perm() drop redundant parameters., (continued)
- [PULL 02/30] block: bdrv_set_perm() drop redundant parameters., Max Reitz, 2020/12/18
- [PULL 01/30] block: add bdrv_refresh_perms() helper, Max Reitz, 2020/12/18
- [PULL 03/30] block: bdrv_child_set_perm() drop redundant parameters., Max Reitz, 2020/12/18
- [PULL 04/30] block: drop tighten_restrictions, Max Reitz, 2020/12/18
- [PULL 07/30] block/io: split out bdrv_find_conflicting_request, Max Reitz, 2020/12/18
- [PULL 06/30] block/io.c: drop assertion on double waiting for request serialisation, Max Reitz, 2020/12/18
- [PULL 09/30] block: bdrv_mark_request_serialising: split non-waiting function, Max Reitz, 2020/12/18
- [PULL 08/30] block/io: bdrv_wait_serialising_requests_locked: drop extra bs arg, Max Reitz, 2020/12/18
- [PULL 05/30] block: simplify comment to BDRV_REQ_SERIALISING, Max Reitz, 2020/12/18
- [PULL 10/30] block: introduce BDRV_REQ_NO_WAIT flag, Max Reitz, 2020/12/18
- [PULL 11/30] block: bdrv_check_perm(): process children anyway,
Max Reitz <=
- [PULL 13/30] qemu-io: add preallocate mode parameter for truncate command, Max Reitz, 2020/12/18
- [PULL 14/30] iotests: qemu_io_silent: support --image-opts, Max Reitz, 2020/12/18
- [PULL 12/30] block: introduce preallocate filter, Max Reitz, 2020/12/18
- [PULL 17/30] scripts/simplebench: fix grammar: s/successed/succeeded/, Max Reitz, 2020/12/18
- [PULL 19/30] scripts/simplebench: use standard deviation for +- error, Max Reitz, 2020/12/18
- [PULL 18/30] scripts/simplebench: support iops, Max Reitz, 2020/12/18
- [PULL 20/30] simplebench: rename ascii() to results_to_text(), Max Reitz, 2020/12/18
- [PULL 22/30] simplebench/results_to_text: improve view of the table, Max Reitz, 2020/12/18
- [PULL 24/30] simplebench/results_to_text: make executable, Max Reitz, 2020/12/18
- [PULL 16/30] iotests: add 298 to test new preallocate filter driver, Max Reitz, 2020/12/18