Messages in this thread Patch in this message | | | Date | Thu, 20 Mar 97 21:41 MET | Subject | Fix for isofs/namei.c | From | Martin Buck <> |
| |
ISO 9660 filesystems with RockRidge-extensions behave a bit odd when they are mounted with "check=relaxed" (i.e. not case-sensitive). The problem is that isofs_lookup() in isofs/namei.c always converts the filename to lower case before trying to match it. This makes every file containing an upper case letter inaccessible. This is probably due to the fact that "check=relaxed" initially was only intended to be used together with "norock", but IMHO it is useful on RR filesystems, too.
With the appended patch, isofs_lookup() tries to match the exact name first. If that fails (and "check=relaxed" is set), it converts the name to lower case and retries the match. This should make no difference on filesystems without RR extensions and it has the benefit of doing something useful even on RR filesystems. So you can add "check=relaxed" to /etc/fstab and don't have to worry whether you mount a CD-ROM with or without RR extensions.
The patch was made against 2.0.29, but it should work with 2.1.x without any problems.
--- linux/fs/isofs/namei.c.orig Sat Apr 13 11:14:45 1996 +++ linux/fs/isofs/namei.c Thu Mar 20 02:48:29 1997 @@ -242,9 +242,12 @@ if (!ino) { char *lcname; - /* If mounted with check=relaxed (and most likely norock), - then first convert this name to lower case. */ - if (dir->i_sb->u.isofs_sb.s_name_check == 'r' + /* First try the original name. If that doesn't work and the fs + * was mounted with check=relaxed, convert the name to lower + * case and try again. + */ + if (!(bh = isofs_find_entry(dir,name,len, &ino, &ino_back)) + && dir->i_sb->u.isofs_sb.s_name_check == 'r' && (lcname = kmalloc(len, GFP_KERNEL)) != NULL) { int i; char c; @@ -256,8 +259,7 @@ } bh = isofs_find_entry(dir,lcname,len, &ino, &ino_back); kfree(lcname); - } else - bh = isofs_find_entry(dir,name,len, &ino, &ino_back); + } if (!bh) { iput(dir);
-- /* Martin Buck E-Mail: martin-2.buck@student.uni-ulm.de */ /* Student of electrical engineering WWW: http://www.uni-ulm.de/~s_mbuck1/ */ /* University of Ulm, Germany Snail-Mail: Paukengasse 2, 89077 Ulm, Germany */ #include <disclaimer.h> /* PGP Key available MIME-Mail welcome */
| |