public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW lib/device/device.c
@ 2011-03-13 22:52 zkabelac
  0 siblings, 0 replies; 4+ messages in thread
From: zkabelac @ 2011-03-13 22:52 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-03-13 22:52:20

Modified files:
	.              : WHATS_NEW 
	lib/device     : device.c 

Log message:
	Fix usage of readlink
	
	Return value of readlink limits valid string size.
	Characters after returned size present some garbage to printf.
	Fix it by placing '\0' on the return size value.

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

--- LVM2/WHATS_NEW	2011/03/11 15:10:16	1.1951
+++ LVM2/WHATS_NEW	2011/03/13 22:52:16	1.1952
@@ -1,5 +1,6 @@
 Version 2.02.85 - 
 ===================================
+  Fix readlink usage inside get_primary_dev().
   Use format instance mempool where possible and adequate.
   Call destroy_instance for any PVs found in VG structure during vg_free call.
   Add new free_pv_fid fn and use it throughout to free all attached fids.
--- LVM2/lib/device/device.c	2010/12/15 12:49:55	1.36
+++ LVM2/lib/device/device.c	2011/03/13 22:52:20	1.37
@@ -287,7 +287,7 @@
 	struct stat info;
 	FILE *fp;
 	uint32_t pri_maj, pri_min;
-	int ret = 0;
+	int size, ret = 0;
 
 	/* check if dev is a partition */
 	if (dm_snprintf(path, PATH_MAX, "%s/dev/block/%d:%d/partition",
@@ -309,11 +309,13 @@
 	 * - basename ../../block/md0/md0  = md0
 	 * Parent's 'dev' sysfs attribute  = /sys/block/md0/dev
 	 */
-	if (readlink(dirname(path), temp_path, PATH_MAX) < 0) {
+	if ((size = readlink(dirname(path), temp_path, PATH_MAX)) < 0) {
 		log_sys_error("readlink", path);
 		return ret;
 	}
 
+	temp_path[size] = '\0';
+
 	if (dm_snprintf(path, PATH_MAX, "%s/block/%s/dev",
 			sysfs_dir, basename(dirname(temp_path))) < 0) {
 		log_error("dm_snprintf dev failed");


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

* LVM2 ./WHATS_NEW lib/device/device.c
@ 2010-12-15 12:49 agk
  0 siblings, 0 replies; 4+ messages in thread
From: agk @ 2010-12-15 12:49 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-12-15 12:49:55

Modified files:
	.              : WHATS_NEW 
	lib/device     : device.c 

Log message:
	Fix device.c #include to ensure 64-bit fopen64 use. (2.02.51)  (robbat2)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1837&r2=1.1838
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/device.c.diff?cvsroot=lvm2&r1=1.35&r2=1.36

--- LVM2/WHATS_NEW	2010/12/13 10:49:02	1.1837
+++ LVM2/WHATS_NEW	2010/12/15 12:49:55	1.1838
@@ -1,5 +1,6 @@
 Version 2.02.79 -  
 ===================================
+  Fix device.c #include to ensure 64-bit fopen64 use. (2.02.51)
   Create /var/run/lvm directory during clvmd initialisation if missing.
   Use new dm_prepare_selinux_context instead of dm_set_selinux_context.
   Avoid revalidating the label cache immediately after scanning.
--- LVM2/lib/device/device.c	2010/10/20 15:07:30	1.35
+++ LVM2/lib/device/device.c	2010/12/15 12:49:55	1.36
@@ -13,7 +13,6 @@
  * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <libgen.h> /* dirname, basename */
 #include "lib.h"
 #include "lvm-types.h"
 #include "device.h"
@@ -21,6 +20,8 @@
 #include "filter.h"
 #include "xlate.h"
 
+#include <libgen.h> /* dirname, basename */
+
 /* See linux/genhd.h and fs/partitions/msdos */
 
 #define PART_MAGIC 0xAA55


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

* LVM2 ./WHATS_NEW lib/device/device.c
@ 2009-07-09 22:50 snitzer
  0 siblings, 0 replies; 4+ messages in thread
From: snitzer @ 2009-07-09 22:50 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2009-07-09 22:50:45

Modified files:
	.              : WHATS_NEW 
	lib/device     : device.c 

Log message:
	Check MD devices for a partition table during device scan.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1174&r2=1.1175
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/device.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27

--- LVM2/WHATS_NEW	2009/07/09 22:34:02	1.1174
+++ LVM2/WHATS_NEW	2009/07/09 22:50:45	1.1175
@@ -1,5 +1,6 @@
 Version 2.02.49 - 
 ================================
+  Check MD devices for a partition table during device scan.
   Add extended device (blkext) and MD partition (mdp) types to filters.
   Fix and precise metadata read errors for segment areas.
   Fix segment metadata read function errors to use proper segment name.
--- LVM2/lib/device/device.c	2008/01/30 13:59:58	1.26
+++ LVM2/lib/device/device.c	2009/07/09 22:50:45	1.27
@@ -43,6 +43,10 @@
 {
 	int parts = max_partitions(MAJOR(dev->dev));
 
+	/* All MD devices are partitionable via blkext (as of 2.6.28) */
+	if (MAJOR(dev->dev) == md_major())
+		return 1;
+
 	if ((parts <= 1) || (MINOR(dev->dev) % parts))
 		return 0;
 


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

* LVM2 ./WHATS_NEW lib/device/device.c
@ 2004-12-21 16:10 agk
  0 siblings, 0 replies; 4+ messages in thread
From: agk @ 2004-12-21 16:10 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-12-21 16:10:26

Modified files:
	.              : WHATS_NEW 
	lib/device     : device.c 

Log message:
	Cope with empty msdos partition tables.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.131&r2=1.132
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/device.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19


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

end of thread, other threads:[~2011-03-13 22:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-13 22:52 LVM2 ./WHATS_NEW lib/device/device.c zkabelac
  -- strict thread matches above, loose matches on Subject: below --
2010-12-15 12:49 agk
2009-07-09 22:50 snitzer
2004-12-21 16:10 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).