Skip to contentSkip to conversation

2.4.31: fix isofs mount options parser

PATCH New Andrey J. Melnikoff (TEMHOTA) 1 participant 1 message Aug 11, 2005 Isofs filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.4.31: fix isofs mount options parser

Hello Marcelo, LKML.

Previos patch incomplete and fix only gcc warnings. New patch attached.

Description:
This patch pix gcc-3.4 warnings, andfix broken logic in mount options parser.

--- cut ---
inode.c: In function `parse_options':
inode.c:341: warning: comparison of unsigned expression < 0 is always false inode.c:347: warning: comparison of unsigned expression < 0 is always false --- cut ---

fs/isofs/inode.c renamed from fs/isofs/inode.c~old +4 -4
@@ -335,15 +335,15 @@
 			else if (!strcmp(value,"acorn")) popt->map = 'a';
 			else return 0;
 		}
-		if (!strcmp(this_char,"session") && value) {
+		else if (!strcmp(this_char,"session") && value) {
 			char * vpnt = value;
-			unsigned int ivalue = simple_strtoul(vpnt, &vpnt, 0);
+			int ivalue = simple_strtoul(vpnt, &vpnt, 0);
 			if(ivalue < 0 || ivalue >99) return 0;
 			popt->session=ivalue+1;
 		}
-		if (!strcmp(this_char,"sbsector") && value) {
+		else if (!strcmp(this_char,"sbsector") && value) {
 			char * vpnt = value;
-			unsigned int ivalue = simple_strtoul(vpnt, &vpnt, 0);
+			int ivalue = simple_strtoul(vpnt, &vpnt, 0);
 			if(ivalue < 0 || ivalue >660*512) return 0;
 			popt->sbsector=ivalue;
 		}
Signature · 2 lines
 Best regards, TEMHOTA-RIPN aka MJA13-RIPE
 System Administrator. mailto:[email protected]
fs/isofs/inode.c renamed from fs/isofs/inode.c~old +4 -4
@@ -335,15 +335,15 @@
 			else if (!strcmp(value,"acorn")) popt->map = 'a';
 			else return 0;
 		}
-		if (!strcmp(this_char,"session") && value) {
+		else if (!strcmp(this_char,"session") && value) {
 			char * vpnt = value;
-			unsigned int ivalue = simple_strtoul(vpnt, &vpnt, 0);
+			int ivalue = simple_strtoul(vpnt, &vpnt, 0);
 			if(ivalue < 0 || ivalue >99) return 0;
 			popt->session=ivalue+1;
 		}
-		if (!strcmp(this_char,"sbsector") && value) {
+		else if (!strcmp(this_char,"sbsector") && value) {
 			char * vpnt = value;
-			unsigned int ivalue = simple_strtoul(vpnt, &vpnt, 0);
+			int ivalue = simple_strtoul(vpnt, &vpnt, 0);
 			if(ivalue < 0 || ivalue >660*512) return 0;
 			popt->sbsector=ivalue;
 		}