[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH] (2/11) various minor cleanups



Hi,

just un-interesting minor changes that have happened while working on lvmlib.

Yours,
   Petr.

Tue Oct 14 14:41:51 CEST 2008  Petr Rockai <me mornfall net>
  * Reduce noise from t-unlost-pv.sh test.
Tue Sep 30 23:34:00 CEST 2008  me mornfall net
  * Give better error in dev_write for read-only devices.
Sat Jul 12 14:56:07 CEST 2008  me mornfall net
  * Fix comment.
diff -rN -p -u old-lvmlib-b/lib/device/dev-io.c new-lvmlib-b/lib/device/dev-io.c
--- old-lvmlib-b/lib/device/dev-io.c	2008-10-30 17:43:21.097833255 +0100
+++ new-lvmlib-b/lib/device/dev-io.c	2008-10-30 17:43:21.161836711 +0100
@@ -622,6 +622,11 @@ int dev_write(struct device *dev, uint64
 	where.start = offset;
 	where.size = len;
 
+	if (!vg_write_lock_held()) {
+		log_error("Attempted to write unlocked VG's device.");
+		return_0;
+	}
+
 	dev->flags |= DEV_ACCESSED_W;
 
 	return _aligned_io(&where, buffer, 1);
diff -rN -p -u old-lvmlib-b/test/t-unlost-pv.sh new-lvmlib-b/test/t-unlost-pv.sh
--- old-lvmlib-b/test/t-unlost-pv.sh	2008-10-30 17:43:21.097833255 +0100
+++ new-lvmlib-b/test/t-unlost-pv.sh	2008-10-30 17:43:21.117836496 +0100
@@ -22,7 +22,7 @@ exit 0 # FIXME, bug demonstration code f
 # try to just change metadata; we expect the new version (with MISSING_PV set
 # on the reappeared volume) to be written out to the previously missing PV
 vgextend $vg $dev1
-disable_dev $dev1
+aux disable_dev $dev1
 lvremove $vg/mirror
-enable_dev $dev1
+aux enable_dev $dev1
 check
diff -rN -p -u old-lvmlib-b/tools/pvdisplay.c new-lvmlib-b/tools/pvdisplay.c
--- old-lvmlib-b/tools/pvdisplay.c	2008-10-30 17:43:21.097833255 +0100
+++ new-lvmlib-b/tools/pvdisplay.c	2008-10-30 17:43:21.129837462 +0100
@@ -37,7 +37,7 @@ static int _pvdisplay_single(struct cmd_
 
 	 	/*
 		 * Replace possibly incomplete PV structure with new one
-		 * allocated in vg_read_internal() path.
+		 * allocated in vg_read() path.
 		 */
 		 if (!(pvl = find_pv_in_vg(vg, pv_name))) {
 			 log_error("Unable to find \"%s\" in volume group \"%s\"",

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

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]