[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/17] sheepdog: Consistently set bdrv_has_zero_init_truncate
From: |
Eric Blake |
Subject: |
[PATCH 08/17] sheepdog: Consistently set bdrv_has_zero_init_truncate |
Date: |
Fri, 31 Jan 2020 11:44:27 -0600 |
block_int.h claims that .bdrv_has_zero_init must return 0 if
.bdrv_has_zero_init_truncate does likewise; but this is violated if
only the former callback is provided if .bdrv_co_truncate also exists.
When adding the latter callback, it was mistakenly added to only one
of the three possible sheepdog instantiations.
Fixes: 1dcaf527
Signed-off-by: Eric Blake <address@hidden>
---
block/sheepdog.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block/sheepdog.c b/block/sheepdog.c
index cfa84338a2d6..522c16a93676 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -3269,6 +3269,7 @@ static BlockDriver bdrv_sheepdog_tcp = {
.bdrv_co_create = sd_co_create,
.bdrv_co_create_opts = sd_co_create_opts,
.bdrv_has_zero_init = bdrv_has_zero_init_1,
+ .bdrv_has_zero_init_truncate = bdrv_has_zero_init_1,
.bdrv_getlength = sd_getlength,
.bdrv_get_allocated_file_size = sd_get_allocated_file_size,
.bdrv_co_truncate = sd_co_truncate,
@@ -3307,6 +3308,7 @@ static BlockDriver bdrv_sheepdog_unix = {
.bdrv_co_create = sd_co_create,
.bdrv_co_create_opts = sd_co_create_opts,
.bdrv_has_zero_init = bdrv_has_zero_init_1,
+ .bdrv_has_zero_init_truncate = bdrv_has_zero_init_1,
.bdrv_getlength = sd_getlength,
.bdrv_get_allocated_file_size = sd_get_allocated_file_size,
.bdrv_co_truncate = sd_co_truncate,
--
2.24.1
- [PATCH 00/17] Improve qcow2 all-zero detection, Eric Blake, 2020/01/31
- [PATCH 01/17] qcow2: Comment typo fixes, Eric Blake, 2020/01/31
- [PATCH 04/17] block: Improve documentation of .bdrv_has_zero_init, Eric Blake, 2020/01/31
- [PATCH 02/17] qcow2: List autoclear bit names in header, Eric Blake, 2020/01/31
- [PATCH 05/17] block: Don't advertise zero_init_truncate with encryption, Eric Blake, 2020/01/31
- [PATCH 07/17] gluster: Drop useless has_zero_init callback, Eric Blake, 2020/01/31
- [PATCH 06/17] block: Improve bdrv_has_zero_init_truncate with backing file, Eric Blake, 2020/01/31
- [PATCH 08/17] sheepdog: Consistently set bdrv_has_zero_init_truncate,
Eric Blake <=
- [PATCH 03/17] qcow2: Avoid feature name extension on small cluster size, Eric Blake, 2020/01/31
- [PATCH 10/17] block: Add new BDRV_ZERO_OPEN flag, Eric Blake, 2020/01/31
- [PATCH 11/17] file-posix: Support BDRV_ZERO_OPEN, Eric Blake, 2020/01/31
- [PATCH 09/17] block: Refactor bdrv_has_zero_init{,_truncate}, Eric Blake, 2020/01/31
- [PATCH 12/17] gluster: Support BDRV_ZERO_OPEN, Eric Blake, 2020/01/31
- [PATCH 13/17] qcow2: Add new autoclear feature for all zero image, Eric Blake, 2020/01/31
- [PATCH 15/17] qcow2: Implement all-zero autoclear bit, Eric Blake, 2020/01/31
- [PATCH 17/17] qcow2: Let qemu-img check cover all-zero bit, Eric Blake, 2020/01/31
- [PATCH 16/17] iotests: Add new test for qcow2 all-zero bit, Eric Blake, 2020/01/31