public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: agk@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2/lib activate/activate.c metadata/mirror.c ...
Date: Wed, 16 Jan 2008 19:18:00 -0000	[thread overview]
Message-ID: <20080116191851.16805.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-01-16 19:18:51

Modified files:
	lib/activate   : activate.c 
	lib/metadata   : mirror.c 
	lib/mirror     : mirrored.c 

Log message:
	allow a mirror to contain only one mimage

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.129&r2=1.130
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.56&r2=1.57
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.47&r2=1.48

--- LVM2/lib/activate/activate.c	2008/01/09 15:32:19	1.129
+++ LVM2/lib/activate/activate.c	2008/01/16 19:18:50	1.130
@@ -508,6 +508,13 @@
 	struct dev_manager *dm;
 	struct lvinfo info;
 
+	/* If mirrored LV is temporarily shrinked to 1 area (= linear),
+	 * it should be considered in-sync. */
+	if (list_size(&lv->segments) == 1 && first_seg(lv)->area_count == 1) {
+		*percent = 100.0;
+		return 1;
+	}
+
 	if (!activation())
 		return 0;
 
--- LVM2/lib/metadata/mirror.c	2008/01/16 19:13:51	1.56
+++ LVM2/lib/metadata/mirror.c	2008/01/16 19:18:51	1.57
@@ -956,7 +956,7 @@
 	list_iterate_items(seg, &lv_mirr->segments) {
 		denominator += seg->area_len;
 
-		if (seg_is_mirrored(seg))
+		if (seg_is_mirrored(seg) && seg->area_count > 1)
 			numerator += seg->extents_copied;
 		else
 			numerator += seg->area_len;
--- LVM2/lib/mirror/mirrored.c	2008/01/16 15:24:25	1.47
+++ LVM2/lib/mirror/mirrored.c	2008/01/16 19:18:51	1.48
@@ -283,6 +283,11 @@
 
 	mirr_state = *target_state;
 
+	/* Mirror segment could have only 1 area temporarily,
+	 * if the segment is under conversion. */
+ 	if (seg->area_count == 1)
+		mirror_status = MIRR_DISABLED;
+
 	/*
 	 * For pvmove, only have one mirror segment RUNNING at once.
 	 * Segments before this are COMPLETED and use 2nd area.


                 reply	other threads:[~2008-01-16 19:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080116191851.16805.qmail@sourceware.org \
    --to=agk@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).