[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/9] block/export: Don't ignore image activation error in blk_exp
From: |
Kevin Wolf |
Subject: |
[PATCH 4/9] block/export: Don't ignore image activation error in blk_exp_add() |
Date: |
Wed, 22 Jan 2025 12:50:41 +0100 |
Currently, block jobs can't handle inactive images correctly. Incoming
write requests would run into assertion failures. Make sure that we
return an error when creating an export can't activate the image.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/export/export.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/block/export/export.c b/block/export/export.c
index 79c71ee245..bac42b8608 100644
--- a/block/export/export.c
+++ b/block/export/export.c
@@ -145,7 +145,11 @@ BlockExport *blk_exp_add(BlockExportOptions *export, Error
**errp)
* ctx was acquired in the caller.
*/
bdrv_graph_rdlock_main_loop();
- bdrv_activate(bs, NULL);
+ ret = bdrv_activate(bs, errp);
+ if (ret < 0) {
+ bdrv_graph_rdunlock_main_loop();
+ goto fail;
+ }
bdrv_graph_rdunlock_main_loop();
perm = BLK_PERM_CONSISTENT_READ;
--
2.48.1
- [PATCH 0/9] block: Managing inactive nodes (QSD migration), Kevin Wolf, 2025/01/22
- [PATCH 4/9] block/export: Don't ignore image activation error in blk_exp_add(),
Kevin Wolf <=
- [PATCH 3/9] block: Support inactive nodes in blk_insert_bs(), Kevin Wolf, 2025/01/22
- [PATCH 2/9] block: Add option to create inactive nodes, Kevin Wolf, 2025/01/22
- [PATCH 6/9] nbd/server: Support inactive nodes, Kevin Wolf, 2025/01/22
- [PATCH 7/9] block: Add blockdev-set-active QMP command, Kevin Wolf, 2025/01/22
- [PATCH 8/9] iotests: Add filter_qtest(), Kevin Wolf, 2025/01/22
- [PATCH 9/9] iotests: Add qsd-migrate case, Kevin Wolf, 2025/01/22