Re: kernel 2.4.27-10: isofs driver ignore some parameters with mount

From: Horms
Date: Fri Aug 12 2005 - 03:33:03 EST


On Fri, Aug 12, 2005 at 10:44:17AM +0300, Alexander Pytlev wrote:
> Hello Debian,
>
> Kernel 2.4.27-10
> With mount isofs filesystem, any mount parameters after
> iocharset=,map=,session= are ignored.
>
> Sample:
>
> mount -t isofs -o uid=100,iocharset=koi8-r,gid=100 /dev/cdrom /media/cdrom
>
> gid=100 - was ignored
>
> I look in source and find that problem. I make two patch, simply and full
> (what addeded some functionality - ignore wrong mount parameters)

Thanks,

I will try and get the simple version of this patch into the next
Sarge update.

I have also CCed Marcelo and the LKML for their consideration,
as this problem still seems to be present in the lastest 2.4 tree.

--
Horms

simply patch:
===================================================================================
--- kernel-source-2.4.27/fs/isofs/inode.c 2005-05-19 13:29:39.000000000 +0300
+++ kernel-source/fs/isofs/inode.c 2005-08-11 11:55:12.000000000 +0300
@@ -340,13 +340,13 @@
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);
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);
if(ivalue < 0 || ivalue >660*512) return 0;
===================================================================================

full patch:
===================================================================================
--- kernel-source-2.4.27/fs/isofs/inode.c 2005-05-19 13:29:39.000000000 +0300
+++ kernel-source/fs/isofs/inode.c 2005-08-11 11:50:56.000000000 +0300
@@ -327,10 +327,11 @@
popt->iocharset = value;
while (*value && *value != ',')
value++;
- if (value == popt->iocharset)
- return 0;
*value = 0;
- } else
+ if (value == popt->iocharset){
+ printk("Invalid or missed parameter:%s=%s,\n",this_char,value);
+ }
+ }
#endif
if (!strcmp(this_char,"map") && value) {
if (value[0] && !value[1] && strchr("ano",*value))
@@ -338,28 +339,30 @@
else if (!strcmp(value,"off")) popt->map = 'o';
else if (!strcmp(value,"normal")) popt->map = 'n';
else if (!strcmp(value,"acorn")) popt->map = 'a';
- else return 0;
+ else printk("Invalid or missed parameter:%s=%s,\n",this_char,value);
}
if (!strcmp(this_char,"session") && value) {
char * vpnt = value;
unsigned int ivalue = simple_strtoul(vpnt, &vpnt, 0);
- if(ivalue < 0 || ivalue >99) return 0;
- popt->session=ivalue+1;
+ if(ivalue < 0 || ivalue >99)
+ printk("Invalid or missed parameter:%s=%s,\n",this_char,value);
+ else popt->session=ivalue+1;
}
if (!strcmp(this_char,"sbsector") && value) {
char * vpnt = value;
unsigned int ivalue = simple_strtoul(vpnt, &vpnt, 0);
- if(ivalue < 0 || ivalue >660*512) return 0;
- popt->sbsector=ivalue;
+ if(ivalue < 0 || ivalue >660*512)
+ printk("Invalid or missed parameter:%s=%s,\n",this_char,value);
+ else popt->sbsector=ivalue;
}
- else if (!strcmp(this_char,"check") && value) {
+ if (!strcmp(this_char,"check") && value) {
if (value[0] && !value[1] && strchr("rs",*value))
popt->check = *value;
else if (!strcmp(value,"relaxed")) popt->check = 'r';
else if (!strcmp(value,"strict")) popt->check = 's';
- else return 0;
+ else printk("Invalid or missed parameter:%s=%s,\n",this_char,value);
}
- else if (!strcmp(this_char,"conv") && value) {
+ if (!strcmp(this_char,"conv") && value) {
/* no conversion is done anymore;
we still accept the same mount options,
but ignore them */
@@ -368,22 +371,24 @@
else if (!strcmp(value,"text")) ;
else if (!strcmp(value,"mtext")) ;
else if (!strcmp(value,"auto")) ;
- else return 0;
+ else printk("Invalid or missed parameter:%s=%s,\n",this_char,value);
}
- else if (value &&
+ if (value &&
(!strcmp(this_char,"block") ||
!strcmp(this_char,"mode") ||
!strcmp(this_char,"uid") ||
!strcmp(this_char,"gid"))) {
char * vpnt = value;
unsigned int ivalue = simple_strtoul(vpnt, &vpnt, 0);
- if (*vpnt) return 0;
+ if (*vpnt) printk("Invalid or missed parameter:%s=%s,\n",this_char,value);
+ else
switch(*this_char) {
case 'b':
if ( ivalue != 512
&& ivalue != 1024
- && ivalue != 2048) return 0;
- popt->blocksize = ivalue;
+ && ivalue != 2048)
+ printk("Invalid or missed parameter:%s=%s,\n",this_char,value);
+ else popt->blocksize = ivalue;
break;
case 'u':
popt->uid = ivalue;
@@ -396,7 +401,6 @@
break;
}
}
- else return 1;
}
return 1;
}
===================================================================================

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/