public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW lib/metadata/lv.c
@ 2012-02-27 11:13 zkabelac
  0 siblings, 0 replies; 3+ messages in thread
From: zkabelac @ 2012-02-27 11:13 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-27 11:13:48

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv.c 

Log message:
	Fix missing break
	
	Bug introduced with addition of internal error default case.
	Seem like this code is not used.
	TODO: add coverage test.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2314&r2=1.2315
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv.c.diff?cvsroot=lvm2&r1=1.38&r2=1.39

--- LVM2/WHATS_NEW	2012/02/27 10:15:08	1.2314
+++ LVM2/WHATS_NEW	2012/02/27 11:13:48	1.2315
@@ -1,5 +1,6 @@
 Version 2.02.94 - 
 ====================================
+  Fix missing break in _format_pvsegs (2.02.92).
   Test seg pointer for non-null it in raid_target_percent error path.
   Check for errors in _init_tags() during config loading.
   Always check result of _set_vg_name() in lvcreate.
--- LVM2/lib/metadata/lv.c	2012/02/23 22:31:23	1.38
+++ LVM2/lib/metadata/lv.c	2012/02/27 11:13:48	1.39
@@ -53,6 +53,7 @@
 		case AREA_UNASSIGNED:
 			name = "unassigned";
 			extent = 0;
+			break;
 		default:
 			log_error(INTERNAL_ERROR "Unknown area segtype.");
 			return NULL;


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

* LVM2 ./WHATS_NEW lib/metadata/lv.c
@ 2012-01-20 10:55 zkabelac
  0 siblings, 0 replies; 3+ messages in thread
From: zkabelac @ 2012-01-20 10:55 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-01-20 10:55:28

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv.c 

Log message:
	Drop hack in segtype reporting
	
	Since striped name function knows when to report 'linear' instead of
	'stripe' type name - drop it from this place.
	
	This fixes problem when reporting segtype e.g. for thin-pool which
	is also using area_count=1 to store thin data device reference.
	
	It also returns properly strduped memory instead of badly casted const char*.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2226&r2=1.2227
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33

--- LVM2/WHATS_NEW	2012/01/20 03:56:18	1.2226
+++ LVM2/WHATS_NEW	2012/01/20 10:55:28	1.2227
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Do not report linear segtype for non-striped targets.
   Keep info about creation host and time for each logical volume.
   Make error message hit when preallocated memlock memory exceeded clearer.
   Use R lv_attr to indicate read-only activation of non-read-only device in lvs.
--- LVM2/lib/metadata/lv.c	2012/01/19 15:34:33	1.32
+++ LVM2/lib/metadata/lv.c	2012/01/20 10:55:28	1.33
@@ -116,10 +116,6 @@
 
 char *lvseg_segtype_dup(struct dm_pool *mem, const struct lv_segment *seg)
 {
-	if (seg->area_count == 1) {
-		return (char *)"linear";
-	}
-
 	return dm_pool_strdup(mem, seg->segtype->ops->name(seg));
 }
 


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

* LVM2 ./WHATS_NEW lib/metadata/lv.c
@ 2011-09-23 15:17 jbrassow
  0 siblings, 0 replies; 3+ messages in thread
From: jbrassow @ 2011-09-23 15:17 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2011-09-23 15:17:54

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv.c 

Log message:
	Add 'Volume Type' lv_attr characters for RAID and RAID_IMAGE.
	
	RAID_META is already handled.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2132&r2=1.2133
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29

--- LVM2/WHATS_NEW	2011/09/22 17:39:56	1.2132
+++ LVM2/WHATS_NEW	2011/09/23 15:17:54	1.2133
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Add 'Volume Type' lv_attr characters for RAID and RAID_IMAGE.
   Add activation/retry_deactivation to lvm.conf to retry deactivation of an LV.
   Replace open_count check with holders/mounted_fs check on lvremove path.
   Disallow the creation of mirrors (mirror or raid1 segtype) with only one leg.
--- LVM2/lib/metadata/lv.c	2011/09/14 10:03:15	1.28
+++ LVM2/lib/metadata/lv.c	2011/09/23 15:17:54	1.29
@@ -304,6 +304,48 @@
 	return (percent == PERCENT_100) ? 1 : 0;
 }
 
+static int _lv_raid_image_in_sync(const struct logical_volume *lv)
+{
+	percent_t percent;
+	struct lv_segment *raid_seg;
+
+	if (!(lv->status & RAID_IMAGE)) {
+		log_error(INTERNAL_ERROR "%s is not a RAID image", lv->name);
+		return 0;
+	}
+
+	raid_seg = get_only_segment_using_this_lv(first_seg(lv)->lv);
+	if (!raid_seg) {
+		log_error("Failed to find RAID segment for %s", lv->name);
+		return 0;
+	}
+
+	if (!seg_is_raid(raid_seg)) {
+		log_error("%s on %s is not a RAID segment",
+			  raid_seg->lv->name, lv->name);
+		return 0;
+	}
+
+	if (!lv_raid_percent(raid_seg->lv, &percent))
+		return_0;
+
+	if (percent == PERCENT_100)
+		return 1;
+
+	/*
+	 * FIXME:  Get individual RAID image status.
+	 * The status health characters reported from a RAID target
+	 * indicate whether the whole array or just individual devices
+	 * are in-sync.  If the corresponding character for this image
+	 * was 'A', we could report a more accurate status.  This is
+	 * especially so in the case of failures or rebuildings.
+	 *
+	 * We need to test the health characters anyway to report
+	 * the correct 4th attr character.  Just need to figure out
+	 * where to put this functionality.
+	 */
+	return 0;
+}
 char *lv_attr_dup(struct dm_pool *mem, const struct logical_volume *lv)
 {
 	percent_t snap_percent;
@@ -327,6 +369,8 @@
 	/* Origin takes precedence over mirror and thin volume */
 	else if (lv_is_origin(lv))
 		repstr[0] = (lv_is_merging_origin(lv)) ? 'O' : 'o';
+	else if (lv->status & RAID)
+		repstr[0] = (lv->status & LV_NOTSYNCED) ? 'R' : 'r';
 	else if (lv->status & MIRRORED)
 		repstr[0] = (lv->status & LV_NOTSYNCED) ? 'M' : 'm';
 	else if (lv_is_thin_volume(lv))
@@ -341,6 +385,8 @@
 		repstr[0] = 'e';
 	else if (lv->status & MIRROR_IMAGE)
 		repstr[0] = (_lv_mimage_in_sync(lv)) ? 'i' : 'I';
+	else if (lv->status & RAID_IMAGE)
+		repstr[0] = (_lv_raid_image_in_sync(lv)) ? 'i' : 'I';
 	else if (lv->status & MIRROR_LOG)
 		repstr[0] = 'l';
 	else if (lv_is_cow(lv)) {


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

end of thread, other threads:[~2012-02-27 11:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-27 11:13 LVM2 ./WHATS_NEW lib/metadata/lv.c zkabelac
  -- strict thread matches above, loose matches on Subject: below --
2012-01-20 10:55 zkabelac
2011-09-23 15:17 jbrassow

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).