[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/6] block: assert that BlockDriver->bdrv_co_delete_file is alway
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH 6/6] block: assert that BlockDriver->bdrv_co_delete_file is always called with graph rdlock taken |
Date: |
Wed, 16 Nov 2022 08:53:31 -0500 |
The only callers are other callback functions that already run with the graph
rdlock taken.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
block.c | 1 +
include/block/block_int-common.h | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index e54ed300d7..1a6ae08879 100644
--- a/block.c
+++ b/block.c
@@ -747,6 +747,7 @@ int coroutine_fn bdrv_co_delete_file(BlockDriverState *bs,
Error **errp)
IO_CODE();
assert(bs != NULL);
+ assert_bdrv_graph_readable();
if (!bs->drv) {
error_setg(errp, "Block node '%s' is not opened", bs->filename);
diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h
index 03bd28e3c9..20308376c6 100644
--- a/include/block/block_int-common.h
+++ b/include/block/block_int-common.h
@@ -681,7 +681,7 @@ struct BlockDriver {
*/
int coroutine_fn (*bdrv_co_flush)(BlockDriverState *bs);
- /* Delete a created file. */
+ /* Delete a created file. Called with graph rdlock taken. */
int coroutine_fn (*bdrv_co_delete_file)(BlockDriverState *bs,
Error **errp);
--
2.31.1
- [PATCH 0/6] Protect the block layer with a rwlock: part 2, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 1/6] block: assert that bdrv_co_create is always called with graph rdlock taken, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 2/6] block: assert that BlockDriver->bdrv_co_{amend/create} are called with graph rdlock taken, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 6/6] block: assert that BlockDriver->bdrv_co_delete_file is always called with graph rdlock taken,
Emanuele Giuseppe Esposito <=
- [PATCH 3/6] block: assert that BlockDriver->bdrv_co_copy_range_{from/to} is always called with graph rdlock taken, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 4/6] block/dirty-bitmap: assert that BlockDriver->bdrv_co_*_dirty_bitmap are always called with graph rdlock taken, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 5/6] block/io: assert that BlockDriver->bdrv_co_*_snapshot_* are always called with graph rdlock taken, Emanuele Giuseppe Esposito, 2022/11/16
- Re: [PATCH 0/6] Protect the block layer with a rwlock: part 2, Emanuele Giuseppe Esposito, 2022/11/21