All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Allow metadata correction even when PVs are missing
@ 2009-06-10 15:05 Milan Broz
  2009-06-10 17:18 ` Petr Rockai
  0 siblings, 1 reply; 3+ messages in thread
From: Milan Broz @ 2009-06-10 15:05 UTC (permalink / raw)
  To: lvm-devel

Allow metadata correction even when PVs are missing.

Signed-off-by: Milan Broz <mbroz@redhat.com>
---
 lib/metadata/metadata.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index d0b7652..2ca12da 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -1835,6 +1835,7 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
 	int inconsistent_vgid = 0;
 	int inconsistent_pvs = 0;
 	unsigned use_precommitted = precommitted;
+	unsigned saved_handles_missing_pvs = cmd->handles_missing_pvs;
 	struct dm_list *pvids;
 	struct pv_list *pvl, *pvl2;
 	struct dm_list all_pvs;
@@ -2076,11 +2077,14 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
 		log_warn("WARNING: Inconsistent metadata found for VG %s - updating "
 			 "to use version %u", vgname, correct_vg->seqno);
 
+		cmd->handles_missing_pvs = 1;
 		if (!vg_write(correct_vg)) {
 			log_error("Automatic metadata correction failed");
 			vg_release(correct_vg);
+			cmd->handles_missing_pvs = saved_handles_missing_pvs;
 			return NULL;
 		}
+		cmd->handles_missing_pvs = saved_handles_missing_pvs;
 
 		if (!vg_commit(correct_vg)) {
 			log_error("Automatic metadata correction commit "




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] Allow metadata correction even when PVs are missing
  2009-06-10 15:05 [PATCH] Allow metadata correction even when PVs are missing Milan Broz
@ 2009-06-10 17:18 ` Petr Rockai
  2009-06-10 19:51   ` Petr Rockai
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Rockai @ 2009-06-10 17:18 UTC (permalink / raw)
  To: lvm-devel

Milan Broz <mbroz@redhat.com> writes:
> Signed-off-by: Milan Broz <mbroz@redhat.com>
Acked-By: Petr Rockai <prockai@redhat.com>

(As discussed on IRC.)

-- 
Peter Rockai | me()mornfall!net | prockai()redhat!com
 http://blog.mornfall.net | http://web.mornfall.net

"In My Egotistical Opinion, most people's C programs should be
 indented six feet downward and covered with dirt."
     -- Blair P. Houghton on the subject of C program indentation



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Allow metadata correction even when PVs are missing
  2009-06-10 17:18 ` Petr Rockai
@ 2009-06-10 19:51   ` Petr Rockai
  0 siblings, 0 replies; 3+ messages in thread
From: Petr Rockai @ 2009-06-10 19:51 UTC (permalink / raw)
  To: lvm-devel

Same patch, with a test added (who would have guessed that the testsuite
already had a test for this, just disabled since it was broken?)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: recovery-partial.diff
Type: text/x-diff
Size: 1484 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20090610/5877b929/attachment.bin>
-------------- next part --------------

Yours,
   Petr.

-- 
Peter Rockai | me()mornfall!net | prockai()redhat!com
 http://blog.mornfall.net | http://web.mornfall.net

"In My Egotistical Opinion, most people's C programs should be
 indented six feet downward and covered with dirt."
     -- Blair P. Houghton on the subject of C program indentation

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-06-10 19:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-10 15:05 [PATCH] Allow metadata correction even when PVs are missing Milan Broz
2009-06-10 17:18 ` Petr Rockai
2009-06-10 19:51   ` Petr Rockai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.