lkml.org 
[lkml]   [1997]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Linux-2.0.32..
Florian Weimer writes:
> A few weeks ago (just before 2.0.31 ;-), I reported a bug in the vfat
> filesystem: if you use rename(2) to change filenames from upper to
> lower case, you'll end up with a severely screwed up filesystem with
> cross-linked clusters. Shouldn't this problem be addressed in 2.0.32
> as well? (Unfortunately, the article containing a short patch, which
> made rename(2) return an errror in such cases, has alrady expired from
> my linux-kernel archive.)

I think this should qualify as a serious problem with vfat in 2.0.31.
This small patch fixes it so it will no longer corrupt vfat filesystems.

- Gordon

--- linux-2.0.31-clean/fs/vfat/namei.c Thu Dec 5 10:58:28 1996
+++ linux/fs/vfat/namei.c Mon Nov 17 13:57:06 1997
@@ -1439,10 +1439,13 @@
PRINTK(("vfat_rename 8\n"));
if (res < 0) goto rename_done;
} else {
- PRINTK(("vfat_rename 9\n"));
- res = vfat_unlinkx(new_dir,new_name,new_len,1);
- PRINTK(("vfat_rename 10\n"));
- if (res < 0) goto rename_done;
+ /* Is this the same file, different case? */
+ if (new_inode != old_inode) {
+ PRINTK(("vfat_rename 9\n"));
+ res = vfat_unlinkx(new_dir,new_name,new_len,1);
+ PRINTK(("vfat_rename 10\n"));
+ if (res < 0) goto rename_done;
+ }
}
}

\
 
 \ /
  Last update: 2005-03-22 13:40    [from the cache]
©2003-2011 Jasper Spaans