Skip to contentSkip to conversation

master - format_text: Fix precommitted segfault.

PATCH Alasdair Kergon 1 participant 1 message Mar 19, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a515a91fcc8df04b5dfd9fe23ef6925c58846af0
Commit:        a515a91fcc8df04b5dfd9fe23ef6925c58846af0
Parent:        e4fa7563853a0f104dec0872760d4acfa08d2554
Author:        Alasdair G Kergon <[email protected]>
AuthorDate:    Thu Mar 19 11:14:47 2015 +0000
Committer:     Alasdair G Kergon <[email protected]>
CommitterDate: Thu Mar 19 11:14:47 2015 +0000

format_text: Fix precommitted segfault.

The code never mixes reads of committed and precommitted metadata, so there's no need to attempt to set PRECOMMITTED when *use_previous_vg is being set.

---
 lib/format_text/format-text.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/format_text/format-text.c +1 -1
index 6b09d00..bdac7f9 100644
@@ -551,7 +551,7 @@ static struct volume_group *_vg_read_raw_area(struct format_instance *fid,
 				   dev_name(area->dev),
 				   area->start + rlocn->offset, rlocn->size);
 
-	if (precommitted)
+	if (vg && precommitted)
 		vg->status |= PRECOMMITTED;
 
       out: