public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/lib/cache lvmcache.c
@ 2011-12-08 23:18 agk
  0 siblings, 0 replies; 22+ messages in thread
From: agk @ 2011-12-08 23:18 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2011-12-08 23:18:00

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	When dropping the VG metadata from the cache during a VG revert, we must
	reset the 'precomitted' flag, just as we'd clear if we next did a 'commit'.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.119&r2=1.120

--- LVM2/lib/cache/lvmcache.c	2011/10/11 09:09:00	1.119
+++ LVM2/lib/cache/lvmcache.c	2011/12/08 23:18:00	1.120
@@ -205,6 +205,10 @@
 			info->status |= CACHE_INVALID;
 
 	_free_cached_vgmetadata(vginfo);
+
+	/* VG revert */
+	if (drop_precommitted)
+		vginfo->precommitted = 0;
 }
 
 /*


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

* LVM2/lib/cache lvmcache.c
@ 2012-03-01 21:58 zkabelac
  0 siblings, 0 replies; 22+ messages in thread
From: zkabelac @ 2012-03-01 21:58 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-03-01 21:58:55

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Check pointer before deref in debug message

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.132&r2=1.133

--- LVM2/lib/cache/lvmcache.c	2012/03/01 21:57:43	1.132
+++ LVM2/lib/cache/lvmcache.c	2012/03/01 21:58:55	1.133
@@ -1110,8 +1110,8 @@
 
 	if (!is_orphan_vg(vginfo->vgname))
 		log_debug("lvmcache: %s: setting %s VGID to %s",
-			  dev_name(info->dev), vginfo->vgname,
-			  vginfo->vgid);
+			  (info) ? dev_name(info->dev) : "",
+			  vginfo->vgname, vginfo->vgid);
 
 	return 1;
 }


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

* LVM2/lib/cache lvmcache.c
@ 2012-03-01 21:57 zkabelac
  0 siblings, 0 replies; 22+ messages in thread
From: zkabelac @ 2012-03-01 21:57 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-03-01 21:57:43

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Explicitely ignore fail from this label_read

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.131&r2=1.132

--- LVM2/lib/cache/lvmcache.c	2012/02/28 18:20:17	1.131
+++ LVM2/lib/cache/lvmcache.c	2012/03/01 21:57:43	1.132
@@ -498,7 +498,7 @@
 
 	dm_list_iterate_safe(devh, tmp, &devs) {
 		devl = dm_list_item(devh, struct device_list);
-		label_read(devl->dev, &label, UINT64_C(0));
+		(void) label_read(devl->dev, &label, UINT64_C(0));
 		dm_list_del(&devl->list);
 		dm_free(devl);
 	}


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

* LVM2/lib/cache lvmcache.c
@ 2012-02-28 18:20 agk
  0 siblings, 0 replies; 22+ messages in thread
From: agk @ 2012-02-28 18:20 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2012-02-28 18:20:18

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	If lvmetad fails, don't set _has_scanned

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.130&r2=1.131

--- LVM2/lib/cache/lvmcache.c	2012/02/28 11:08:04	1.130
+++ LVM2/lib/cache/lvmcache.c	2012/02/28 18:20:17	1.131
@@ -116,10 +116,15 @@
 
 void lvmcache_seed_infos_from_lvmetad(struct cmd_context *cmd)
 {
-	if (lvmetad_active() && !_has_scanned) {
-		lvmetad_pv_list_to_lvmcache(cmd);
-		_has_scanned = 1;
+	if (!lvmetad_active() || _has_scanned)
+		return;
+
+	if (!lvmetad_pv_list_to_lvmcache(cmd)) {
+		stack;
+		return;
 	}
+
+	_has_scanned = 1;
 };
 
 


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

* LVM2/lib/cache lvmcache.c
@ 2012-02-28 11:08 zkabelac
  0 siblings, 0 replies; 22+ messages in thread
From: zkabelac @ 2012-02-28 11:08 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-28 11:08:04

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Add stacktrace for init_lvmcache_orphans fail path

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.129&r2=1.130

--- LVM2/lib/cache/lvmcache.c	2012/02/28 10:10:07	1.129
+++ LVM2/lib/cache/lvmcache.c	2012/02/28 11:08:04	1.130
@@ -1628,7 +1628,8 @@
 	dm_list_init(&_vginfos);
 
 	if (retain_orphans)
-		init_lvmcache_orphans(cmd);
+		if (!init_lvmcache_orphans(cmd))
+			stack;
 }
 
 int lvmcache_pvid_is_locked(const char *pvid) {


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

* LVM2/lib/cache lvmcache.c
@ 2012-02-28 10:10 zkabelac
  0 siblings, 0 replies; 22+ messages in thread
From: zkabelac @ 2012-02-28 10:10 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-28 10:10:07

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Explicitely ignore errors in label_read iteration.
	
	We don't want stack traces here, so mark as void.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.128&r2=1.129

--- LVM2/lib/cache/lvmcache.c	2012/02/23 22:23:13	1.128
+++ LVM2/lib/cache/lvmcache.c	2012/02/28 10:10:07	1.129
@@ -641,7 +641,7 @@
 	struct label *label;
 
 	if (info->status & CACHE_INVALID)
-		label_read(info->dev, &label, UINT64_C(0));
+		(void) label_read(info->dev, &label, UINT64_C(0));
 }
 
 static int _scan_invalid(void)
@@ -688,7 +688,7 @@
 	}
 
 	while ((dev = dev_iter_get(iter)))
-		label_read(dev, &label, UINT64_C(0));
+		(void) label_read(dev, &label, UINT64_C(0));
 
 	dev_iter_destroy(iter);
 


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

* LVM2/lib/cache lvmcache.c
@ 2012-02-13 14:26 zkabelac
  0 siblings, 0 replies; 22+ messages in thread
From: zkabelac @ 2012-02-13 14:26 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-13 14:26:15

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Add internal error to guard vgname2 NULL dereference

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.125&r2=1.126

--- LVM2/lib/cache/lvmcache.c	2012/02/12 23:01:19	1.125
+++ LVM2/lib/cache/lvmcache.c	2012/02/13 14:26:15	1.126
@@ -321,13 +321,17 @@
 		if (!dm_hash_get_data(_lock_hash, n))
 			return_0;
 
-		vgname2 = dm_hash_get_key(_lock_hash, n);
+		if (!(vgname2 = dm_hash_get_key(_lock_hash, n))) {
+			log_error(INTERNAL_ERROR "VG lock %s hits NULL.",
+				 vgname);
+			return 0;
+		}
 
 		if (!_vgname_order_correct(vgname2, vgname)) {
 			log_errno(EDEADLK, INTERNAL_ERROR "VG lock %s must "
 				  "be requested before %s, not after.",
 				  vgname, vgname2);
-			return_0;
+			return 0;
 		}
 	}
 


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

* LVM2/lib/cache lvmcache.c
@ 2011-04-21 13:15 zkabelac
  0 siblings, 0 replies; 22+ messages in thread
From: zkabelac @ 2011-04-21 13:15 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-04-21 13:15:26

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Skip check for NULL before dm_free
	
	dm_free makes this test itself.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.109&r2=1.110

--- LVM2/lib/cache/lvmcache.c	2011/03/30 13:14:34	1.109
+++ LVM2/lib/cache/lvmcache.c	2011/04/21 13:15:26	1.110
@@ -857,11 +857,8 @@
 		}
  	while ((vginfo2 = vginfo2->next));
 
-	if (vginfo->vgname)
-		dm_free(vginfo->vgname);
-
-	if (vginfo->creation_host)
-		dm_free(vginfo->creation_host);
+	dm_free(vginfo->vgname);
+	dm_free(vginfo->creation_host);
 
 	if (*vginfo->vgid && _vgid_hash &&
 	    vginfo_from_vgid(vginfo->vgid) == vginfo)


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

* LVM2/lib/cache lvmcache.c
@ 2011-03-13 23:01 zkabelac
  0 siblings, 0 replies; 22+ messages in thread
From: zkabelac @ 2011-03-13 23:01 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-03-13 23:01:08

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Use proper size of strncpy
	
	Avoid reading extra character if we expect to have there '\0'.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.106&r2=1.107

--- LVM2/lib/cache/lvmcache.c	2011/03/11 15:08:31	1.106
+++ LVM2/lib/cache/lvmcache.c	2011/03/13 23:01:08	1.107
@@ -1287,7 +1287,7 @@
 		return NULL;
 	}
 
-	strncpy(pvid_s, pvid, sizeof(pvid_s));
+	strncpy(pvid_s, pvid, sizeof(pvid_s) - 1);
 	pvid_s[sizeof(pvid_s) - 1] = '\0';
 
 	if (!(existing = info_from_pvid(pvid_s, 0)) &&


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

* LVM2/lib/cache lvmcache.c
@ 2010-10-25 13:33 zkabelac
  0 siblings, 0 replies; 22+ messages in thread
From: zkabelac @ 2010-10-25 13:33 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-10-25 13:33:43

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Fix constness warnings
	
	After update of device_from_pvid() API fix constness warnings
	Also fix info_from_pvid() constness warning for char* usage.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.96&r2=1.97

--- LVM2/lib/cache/lvmcache.c	2010/10/25 13:02:26	1.96
+++ LVM2/lib/cache/lvmcache.c	2010/10/25 13:33:42	1.97
@@ -514,7 +514,7 @@
 	struct lvmcache_info *info;
 	char *vgname;
 
-	if (!device_from_pvid(cmd, (struct id *)pvid, NULL)) {
+	if (!device_from_pvid(cmd, (const struct id *)pvid, NULL)) {
 		log_error("Couldn't find device with uuid %s.", pvid);
 		return NULL;
 	}
@@ -740,7 +740,7 @@
 	struct lvmcache_info *info;
 
 	/* Already cached ? */
-	if ((info = info_from_pvid((char *) pvid, 0))) {
+	if ((info = info_from_pvid((const char *) pvid, 0))) {
 		if (label_read(info->dev, &label, UINT64_C(0))) {
 			info = (struct lvmcache_info *) label->info;
 			if (id_equal(pvid, (struct id *) &info->dev->pvid))
@@ -751,7 +751,7 @@
 	lvmcache_label_scan(cmd, 0);
 
 	/* Try again */
-	if ((info = info_from_pvid((char *) pvid, 0))) {
+	if ((info = info_from_pvid((const char *) pvid, 0))) {
 		if (label_read(info->dev, &label, UINT64_C(0))) {
 			info = (struct lvmcache_info *) label->info;
 			if (id_equal(pvid, (struct id *) &info->dev->pvid))
@@ -767,7 +767,7 @@
 		*scan_done_once = 1;
 
 	/* Try again */
-	if ((info = info_from_pvid((char *) pvid, 0))) {
+	if ((info = info_from_pvid((const char *) pvid, 0))) {
 		if (label_read(info->dev, &label, UINT64_C(0))) {
 			info = (struct lvmcache_info *) label->info;
 			if (id_equal(pvid, (struct id *) &info->dev->pvid))


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

* LVM2/lib/cache lvmcache.c
@ 2010-04-30 12:54 zkabelac
  0 siblings, 0 replies; 22+ messages in thread
From: zkabelac @ 2010-04-30 12:54 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-04-30 12:54:31

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Initialise _vginfos list staticaly so there is no problem with using uninitialised
	variables in case, lvmcache_destory() is called without lvmcache_init().

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.84&r2=1.85

--- LVM2/lib/cache/lvmcache.c	2010/04/01 10:34:09	1.84
+++ LVM2/lib/cache/lvmcache.c	2010/04/30 12:54:31	1.85
@@ -31,7 +31,7 @@
 static struct dm_hash_table *_vgid_hash = NULL;
 static struct dm_hash_table *_vgname_hash = NULL;
 static struct dm_hash_table *_lock_hash = NULL;
-static struct dm_list _vginfos;
+static DM_LIST_INIT(_vginfos);
 static int _scanning_in_progress = 0;
 static int _has_scanned = 0;
 static int _vgs_locked = 0;


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

* LVM2/lib/cache lvmcache.c
@ 2010-03-16 19:06 agk
  0 siblings, 0 replies; 22+ messages in thread
From: agk @ 2010-03-16 19:06 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-03-16 19:06:58

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	fix last checkin

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.80&r2=1.81

--- LVM2/lib/cache/lvmcache.c	2010/03/16 17:30:01	1.80
+++ LVM2/lib/cache/lvmcache.c	2010/03/16 19:06:57	1.81
@@ -605,9 +605,9 @@
 	    (!precommitted && vginfo->precommitted && !memlock()))
 		return NULL;
 
-	if (!(fid =  vginfo->fmt->ops->create_instance(vginfo->fmt,
-						       vginfo->vgname,
-						       vgid, NULL)))
+	if (!(fid = vginfo->fmt->ops->create_instance(vginfo->fmt,
+						      vginfo->vgname,
+						      vgid, NULL)))
 		return_NULL;
 
 	if (!(vg = import_vg_from_buffer(vginfo->vgmetadata, fid)) ||
@@ -733,7 +733,8 @@
 		return NULL;
 
 	lvmcache_label_scan(cmd, 2);
-	*scan_done_once = 1;
+	if (scan_done_once)
+		*scan_done_once = 1;
 
 	/* Try again */
 	if ((info = info_from_pvid((char *) pvid, 0))) {


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

* LVM2/lib/cache lvmcache.c
@ 2010-01-11 19:12 snitzer
  0 siblings, 0 replies; 22+ messages in thread
From: snitzer @ 2010-01-11 19:12 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2010-01-11 19:12:25

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	remove errant comment fragment

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.76&r2=1.77

--- LVM2/lib/cache/lvmcache.c	2010/01/11 19:08:18	1.76
+++ LVM2/lib/cache/lvmcache.c	2010/01/11 19:12:25	1.77
@@ -42,7 +42,6 @@
 	/*
 	 * FIXME add a proper lvmcache_locking_reset() that
 	 * resets the cache so no previous locks are locked
-	 * - useful for reset_locking()
 	 */
 	_vgs_locked = 0;
 


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

* LVM2/lib/cache lvmcache.c
@ 2010-01-11 19:08 snitzer
  0 siblings, 0 replies; 22+ messages in thread
From: snitzer @ 2010-01-11 19:08 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2010-01-11 19:08:18

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Reset _vgs_locked in lvmcache_init()
	
	Upon successful fork(), _become_daemon() must assert that the locks that
	are currently held belong to the parent, not the child.  All of the
	child's internal state saying 'this process holds a lock' has to be
	reset.
	
	A proper lvmcache_locking_reset() should follow later.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.75&r2=1.76

--- LVM2/lib/cache/lvmcache.c	2010/01/05 16:06:43	1.75
+++ LVM2/lib/cache/lvmcache.c	2010/01/11 19:08:18	1.76
@@ -39,6 +39,13 @@
 
 int lvmcache_init(void)
 {
+	/*
+	 * FIXME add a proper lvmcache_locking_reset() that
+	 * resets the cache so no previous locks are locked
+	 * - useful for reset_locking()
+	 */
+	_vgs_locked = 0;
+
 	dm_list_init(&_vginfos);
 
 	if (!(_vgname_hash = dm_hash_create(128)))


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

* LVM2/lib/cache lvmcache.c
@ 2009-04-24 12:03 mbroz
  0 siblings, 0 replies; 22+ messages in thread
From: mbroz @ 2009-04-24 12:03 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-04-24 12:03:56

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Fix pool leak in lvmcache_read_vg error path.
	(Introduced in previous patches.)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.64&r2=1.65

--- LVM2/lib/cache/lvmcache.c	2009/02/17 18:56:41	1.64
+++ LVM2/lib/cache/lvmcache.c	2009/04/24 12:03:55	1.65
@@ -522,6 +522,7 @@
 	if (!(vg = import_vg_from_buffer(vginfo->vgmetadata, fid)) ||
 	    !vg_validate(vg)) {
 		_free_cached_vgmetadata(vginfo);
+		vg_release(vg);
 		return_NULL;
 	}
 


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

* LVM2/lib/cache lvmcache.c
@ 2008-11-28 15:51 agk
  0 siblings, 0 replies; 22+ messages in thread
From: agk @ 2008-11-28 15:51 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-11-28 15:51:40

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Suppress 'duplicate PV' message when it's only a cache update not a real
	duplicate.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63

--- LVM2/lib/cache/lvmcache.c	2008/11/27 18:13:51	1.62
+++ LVM2/lib/cache/lvmcache.c	2008/11/28 15:51:40	1.63
@@ -713,9 +713,8 @@
 	if (((dm_hash_lookup(_pvid_hash, pvid)) == info) &&
 	    !strcmp(info->dev->pvid, pvid))
 		return 1;
-	if (*info->dev->pvid) {
+	if (*info->dev->pvid)
 		dm_hash_remove(_pvid_hash, info->dev->pvid);
-	}
 	strncpy(info->dev->pvid, pvid, sizeof(info->dev->pvid));
 	if (!dm_hash_insert(_pvid_hash, pvid, info)) {
 		log_error("_lvmcache_update: pvid insertion failed: %s", pvid);
@@ -1140,11 +1139,15 @@
 			//else if (dm_is_dm_major(MAJOR(existing->dev->dev)) &&
 				 //dm_is_dm_major(MAJOR(dev->dev)))
 				 //
-			else
+			else if (!strcmp(pvid_s, existing->dev->pvid)) 
 				log_error("Found duplicate PV %s: using %s not "
 					  "%s", pvid, dev_name(dev),
 					  dev_name(existing->dev));
 		}
+		if (strcmp(pvid_s, existing->dev->pvid)) 
+			log_debug("Updating pvid cache to %s (%s) from %s (%s)",
+				  pvid_s, dev_name(dev),
+				  existing->dev->pvid, dev_name(existing->dev));
 		/* Switch over to new preferred device */
 		existing->dev = dev;
 		info = existing;


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

* LVM2/lib/cache lvmcache.c
@ 2008-06-06 12:43 agk
  0 siblings, 0 replies; 22+ messages in thread
From: agk @ 2008-06-06 12:43 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-06-06 12:43:41

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	fix _free_vginfo not to remove a ref to a *different* vginfo from the vgid cache

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.55&r2=1.56

--- LVM2/lib/cache/lvmcache.c	2008/06/06 11:12:50	1.55
+++ LVM2/lib/cache/lvmcache.c	2008/06/06 12:43:40	1.56
@@ -651,7 +651,8 @@
 	if (vginfo->creation_host)
 		dm_free(vginfo->creation_host);
 
-	if (*vginfo->vgid && _vgid_hash)
+	if (*vginfo->vgid && _vgid_hash &&
+	    vginfo_from_vgid(vginfo->vgid) == vginfo)
 		dm_hash_remove(_vgid_hash, vginfo->vgid);
 
 	list_del(&vginfo->list);


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

* LVM2/lib/cache lvmcache.c
@ 2008-04-15 14:54 agk
  0 siblings, 0 replies; 22+ messages in thread
From: agk @ 2008-04-15 14:54 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-04-15 14:54:00

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	missing stack

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.45&r2=1.46

--- LVM2/lib/cache/lvmcache.c	2008/04/15 14:46:18	1.45
+++ LVM2/lib/cache/lvmcache.c	2008/04/15 14:54:00	1.46
@@ -420,10 +420,10 @@
 	    (!precommitted && vginfo->precommitted))
 		return NULL;
 
-	fid =  vginfo->fmt->ops->create_instance(vginfo->fmt, vginfo->vgname,
-						 vgid, NULL);
-	if (!fid)
-		return NULL;
+	if (!(fid =  vginfo->fmt->ops->create_instance(vginfo->fmt,
+						       vginfo->vgname,
+						       vgid, NULL)))
+		return_NULL;
 
 	if (!(vg = import_vg_from_buffer(vginfo->vgmetadata, fid)) ||
 	    !vg_validate(vg)) {


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

* LVM2/lib/cache lvmcache.c
@ 2008-01-30 16:18 agk
  0 siblings, 0 replies; 22+ messages in thread
From: agk @ 2008-01-30 16:18 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

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

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	only read labels once between each lock event

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.36&r2=1.37

--- LVM2/lib/cache/lvmcache.c	2008/01/30 13:59:58	1.36
+++ LVM2/lib/cache/lvmcache.c	2008/01/30 16:18:37	1.37
@@ -225,6 +225,16 @@
 	if (info->status & CACHE_INVALID)
 		return 0;
 
+	/*
+	 * The caller must hold the VG lock to manipulate metadata.
+	 * In a cluster, remote nodes sometimes read metadata in the
+	 * knowledge that the controlling node is holding the lock.
+	 * So if the VG appears to be unlocked here, it should be safe
+	 * to use the cached value.
+	 */
+	if (info->vginfo && !vgname_is_locked(info->vginfo->vgname))
+		return 1;
+
 	if (!(info->status & CACHE_LOCKED))
 		return 0;
 


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

* LVM2/lib/cache lvmcache.c
@ 2007-11-05 17:12 agk
  0 siblings, 0 replies; 22+ messages in thread
From: agk @ 2007-11-05 17:12 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-11-05 17:12:50

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	fix inverted orphan test

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33

--- LVM2/lib/cache/lvmcache.c	2007/11/02 13:06:41	1.32
+++ LVM2/lib/cache/lvmcache.c	2007/11/05 17:12:50	1.33
@@ -649,7 +649,7 @@
 	vginfo->fmt = info->fmt;
 
 	log_debug("lvmcache: %s: now %s%s%s%s%s", dev_name(info->dev),
-		  is_orphan_vg(vgname) ? "in VG " : "orphaned", vgname,
+		  !is_orphan_vg(vgname) ? "in VG " : "orphaned", vgname,
 		  vginfo->vgid[0] ? " (" : "",
 		  vginfo->vgid[0] ? vginfo->vgid : "",
 		  vginfo->vgid[0] ? ")" : "");


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

* LVM2/lib/cache lvmcache.c
@ 2006-04-21 14:44 agk
  0 siblings, 0 replies; 22+ messages in thread
From: agk @ 2006-04-21 14:44 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-04-21 14:44:33

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Fix vgid string termination in recent cache code.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22


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

* LVM2/lib/cache lvmcache.c
@ 2005-09-16 18:45 agk
  0 siblings, 0 replies; 22+ messages in thread
From: agk @ 2005-09-16 18:45 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-09-16 18:44:56

Modified files:
	lib/cache      : lvmcache.c 

Log message:
	Really switch device number in lvmcache when it says it is doing so.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.6&r2=1.7


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

end of thread, other threads:[~2012-03-01 21:58 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-08 23:18 LVM2/lib/cache lvmcache.c agk
  -- strict thread matches above, loose matches on Subject: below --
2012-03-01 21:58 zkabelac
2012-03-01 21:57 zkabelac
2012-02-28 18:20 agk
2012-02-28 11:08 zkabelac
2012-02-28 10:10 zkabelac
2012-02-13 14:26 zkabelac
2011-04-21 13:15 zkabelac
2011-03-13 23:01 zkabelac
2010-10-25 13:33 zkabelac
2010-04-30 12:54 zkabelac
2010-03-16 19:06 agk
2010-01-11 19:12 snitzer
2010-01-11 19:08 snitzer
2009-04-24 12:03 mbroz
2008-11-28 15:51 agk
2008-06-06 12:43 agk
2008-04-15 14:54 agk
2008-01-30 16:18 agk
2007-11-05 17:12 agk
2006-04-21 14:44 agk
2005-09-16 18:45 agk

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