All of lore.kernel.org
 help / color / mirror / Atom feed
* LVM2/lib/filters filter.c
@ 2011-11-18 19:36 zkabelac
  0 siblings, 0 replies; 3+ messages in thread
From: zkabelac @ 2011-11-18 19:36 UTC (permalink / raw)
  To: lvm-devel

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac at sourceware.org	2011-11-18 19:36:10

Modified files:
	lib/filters    : filter.c 

Log message:
	Remove constant expression check
	
	"result_independent_of_operands: ((dev->dev & 0xfff00UL) >> 8) ==
	18446744073709551615UL /* -1 */ is always false regardless of the values
	of its operands (logical operand of if)."
	
	'dev->dev' is set in dev-cache.c _insert() and it's not expectable
	st_rdev would have '-1'
	
	This code has been introduced with drbd support commit and code never
	worked - so eliminated.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter.c.diff?cvsroot=lvm2&r1=1.65&r2=1.66

--- LVM2/lib/filters/filter.c	2011/11/11 16:59:30	1.65
+++ LVM2/lib/filters/filter.c	2011/11/18 19:36:10	1.66
@@ -64,9 +64,6 @@
 {
 	dev_t primary_dev;
 
-	if (MAJOR(dev->dev) == -1)
-		return 0;
-
 	if (MAJOR(dev->dev) == _md_major)
 		return 1;
 



^ permalink raw reply	[flat|nested] 3+ messages in thread
* LVM2/lib/filters filter.c
@ 2012-02-13 10:45 zkabelac
  0 siblings, 0 replies; 3+ messages in thread
From: zkabelac @ 2012-02-13 10:45 UTC (permalink / raw)
  To: lvm-devel

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac at sourceware.org	2012-02-13 10:45:26

Modified files:
	lib/filters    : filter.c 

Log message:
	Remove duplicit test
	
	When it's space it's also not a '\0'.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter.c.diff?cvsroot=lvm2&r1=1.68&r2=1.69

--- LVM2/lib/filters/filter.c	2012/02/08 12:48:14	1.68
+++ LVM2/lib/filters/filter.c	2012/02/13 10:45:26	1.69
@@ -221,7 +221,7 @@
 
 	while (fgets(line, 80, pd) != NULL) {
 		i = 0;
-		while (line[i] == ' ' && line[i] != '\0')
+		while (line[i] == ' ')
 			i++;
 
 		/* If it's not a number it may be name of section */
@@ -238,7 +238,7 @@
 		/* Find the start of the device major name */
 		while (line[i] != ' ' && line[i] != '\0')
 			i++;
-		while (line[i] == ' ' && line[i] != '\0')
+		while (line[i] == ' ')
 			i++;
 
 		/* Look for md device */



^ permalink raw reply	[flat|nested] 3+ messages in thread
* LVM2/lib/filters filter.c
@ 2011-11-11 16:59 mbroz
  0 siblings, 0 replies; 3+ messages in thread
From: mbroz @ 2011-11-11 16:59 UTC (permalink / raw)
  To: lvm-devel

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz at sourceware.org	2011-11-11 16:59:30

Modified files:
	lib/filters    : filter.c 

Log message:
	Fix major number filter structure boundary test.

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

--- LVM2/lib/filters/filter.c	2011/11/11 15:11:12	1.64
+++ LVM2/lib/filters/filter.c	2011/11/11 16:59:30	1.65
@@ -154,7 +154,7 @@
 		log_debug("%s: Skipping: open failed", name);
 		return 0;
 	}
-	
+
 	/* Check it's not too small */
 	if (!dev_get_size(dev, &size)) {
 		log_debug("%s: Skipping: dev_get_size failed", name);
@@ -319,7 +319,7 @@
 
 int max_partitions(int major)
 {
-	if (major > NUMBER_OF_MAJORS)
+	if (major >= NUMBER_OF_MAJORS)
 		return 0;
 
 	return _partitions[major].max_partitions;
@@ -327,7 +327,7 @@
 
 int major_is_scsi_device(int major)
 {
-	if (major > NUMBER_OF_MAJORS)
+	if (major >= NUMBER_OF_MAJORS)
 		return 0;
 
 	return (_partitions[major].flags & PARTITION_SCSI_DEVICE) ? 1 : 0;



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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-18 19:36 LVM2/lib/filters filter.c zkabelac
  -- strict thread matches above, loose matches on Subject: below --
2012-02-13 10:45 zkabelac
2011-11-11 16:59 mbroz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.