Skip to contentSkip to conversation

main - vdo: skip zeroing for VDO LV

PATCH Zdenek Kabelac 1 participant 1 message Aug 31, 2021

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=88360b0c512d96dfe05c11362ff389ef6bfec6b4
Commit:        88360b0c512d96dfe05c11362ff389ef6bfec6b4
Parent:        62c599f78151e65105c92c87ac406e3f3f360b1a
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Aug 26 23:04:56 2021 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Tue Aug 31 22:05:47 2021 +0200

vdo: skip zeroing for VDO LV

Since VDO is always returns 'zero' on unprovisioned read and every provisioned block is always 'zeroed' on partial writes, we can avoid 'zeroing' of such LVs.

---
 lib/metadata/lv_manip.c | 4 ++++
 1 file changed, 4 insertions(+)
lib/metadata/lv_manip.c +4 -0
index a26d3d533..730e3f0df 100644
@@ -8073,6 +8073,10 @@ static int _should_wipe_lv(struct lvcreate_params *lp,
 	     first_seg(first_seg(lv)->pool_lv)->zero_new_blocks))
 		return 0;
 
+	/* VDO LV do not need to be zeroed */
+	if (lv_is_vdo(lv))
+		return 0;
+
 	if (warn && (lv_passes_readonly_filter(lv))) {
 		log_warn("WARNING: Read-only activated logical volume %s not zeroed.",
 			 display_lvname(lv));