Re: vfat broken in test5-pre4?

From: Matt Yourst (yourst@mit.edu)
Date: Mon Jul 24 2000 - 22:37:06 EST


Urban Widmark wrote:
>
> Petr Vandrovec does. It looks like a bug was introduced with the 16bit nls
> support.
>
> Try the attached patch by Petr and see if it helps. I haven't had time to
> test it myself yet (the bug or the patch).
>

Thanks - the patch works as expected (no more disappearing dots in filenames.) Since I had to apply it manually, here's a version that works with test5-pre4:

--- linux/fs/vfat/namei.c~ Sun Jul 23 01:25:40 2000
+++ linux/fs/vfat/namei.c Mon Jul 24 23:23:53 2000
@@ -453,10 +453,11 @@
                        if (charbuf[chi] != vfat_tolower(nls, c)) return -EINVAL;
                        if (strchr(replace_chars,c)) return -EINVAL;
                        if (c < ' '|| c==':') return -EINVAL;
- if (c == '.') break;
+ if (c == '.') goto dot;
                        space = c == ' ';
                }
        }
+ dot:
        if (space) return -EINVAL;
        if (len && c != '.') {
                len--;
@@ -464,6 +465,7 @@
                        if (charbuf[0] != '.') return -EINVAL;
                } else
                        return -EINVAL;
+ c = '.';
        }
        if (c == '.') {
                if (len >= 4) return -EINVAL;
@@ -522,7 +524,7 @@
                if (chl == 0)
                        return -EINVAL;
                for (chi = 0; chi < chl; chi++){
- if (charbuf[chi] == '.') break;
+ if (charbuf[chi] == '.') goto dot;
                        if (!charbuf[chi]) return -EINVAL;
                        if (walk-res == 8) return -EINVAL;
                        if (strchr(replace_chars,charbuf[chi])) return -EINVAL;
@@ -532,6 +534,7 @@
                        walk++;
                }
        }
+ dot:
        if (space) return -EINVAL;
        if (len >= 0) {
                while (walk-res < 8) *walk++ = ' ';

-------------------------------------------------------------
 Matt T. Yourst Massachusetts Institute of Technology
 yourst@mit.edu 617.225.7690
 513 French House - 476 Memorial Drive - Cambridge, MA 02136
-------------------------------------------------------------

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



This archive was generated by hypermail 2b29 : Mon Jul 31 2000 - 21:00:18 EST