diff options
author | Vladimir Sementsov-Ogievskiy | 2020-10-21 16:58:45 +0200 |
---|---|---|
committer | Max Reitz | 2020-12-18 12:35:55 +0100 |
commit | 9530a25b8b7eb5cc1800b66ee617610cd43f0fad (patch) | |
tree | 47b99abb97aea981321449c706e9a2be1a25f1ae | |
parent | block: introduce BDRV_REQ_NO_WAIT flag (diff) | |
download | qemu-9530a25b8b7eb5cc1800b66ee617610cd43f0fad.tar.gz qemu-9530a25b8b7eb5cc1800b66ee617610cd43f0fad.tar.xz qemu-9530a25b8b7eb5cc1800b66ee617610cd43f0fad.zip |
block: bdrv_check_perm(): process children anyway
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>
-rw-r--r-- | block.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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() */ |