Skip to contentSkip to conversation

master - lvresize: fix zero size extension

PATCH Zdenek Kabelac 1 participant 1 message Jul 13, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e1112227d19cc252e1404eb4bf44d03e3867e463
Commit:        e1112227d19cc252e1404eb4bf44d03e3867e463
Parent:        3928c96a37941d765bf467d82502cd2aec7fd809
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Wed Jul 13 16:23:25 2016 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Wed Jul 13 21:52:04 2016 +0200

lvresize: fix zero size extension

Commit ca878a3426197b629c76e98cfc049948da470cd7 changed behavior or resize operation. Later the code has been futher changed to skip fs resize completely when size of LV is already matching and finaly at the most recent resize changeset for resize the check for matching size has been eliminated as well so we ended with a request call to resize fs to 0 size in some cases.

This commit reoders some test so the prompt happens just once before resize of possibly 2 related volumes.

Also extra test for having LV already given size is added, and whole metadata update is skipped for this case as the only result would be an increment of seqno.

However the filesystem is still resized when requested, so if the LV has some size and the resize is resolved to the same size, the filesystem resize is called so in case FS would not match, the resize will happen.

---
 WHATS_NEW                        |    1 +
 lib/metadata/lv_manip.c          |   88 ++++++++++++++++++++++----------------
 lib/metadata/metadata-exported.h |    1 +
 3 files changed, 53 insertions(+), 37 deletions(-)
WHATS_NEW +1 -0
index 5653b13..3ed398c 100644
@@ -1,5 +1,6 @@
 Version 2.02.161 - 
 ================================
+  Fix lvresize of filesystem when LV has already right size (2.02.141).
   New LVM_LOG_FILE_MAX_LINES env var to limit max size of created logs.
 
 Version 2.02.160 - 6th July 2016
lib/metadata/lv_manip.c +51 -37

158 lines not on this page · raw message

lib/metadata/metadata-exported.h +1 -0
index 7765d23..84b510b 100644
@@ -637,6 +637,7 @@ struct lvresize_params {
 
 	int approx_alloc;
 	int extents_are_pes;	/* Is 'extents' counting PEs or LEs? */
+	int size_changed;	/* Was there actually a size change */
 };
 
 void pvcreate_params_set_defaults(struct pvcreate_params *pp);