Patch for vfat (Was Re: 2.1.75, and VFAT still broken)

Gordon Chaffee (chaffee@CS.Berkeley.EDU)
Mon, 22 Dec 1997 23:48:53 -0800 (PST)


Alberto Vignani writes:
> B) VFAT is not yet fixed, I still get errors after deleting files.
> This time I got in the logs:
>
> "Filesystem panic (dev 16:06).
> fat_free: deleting beyond EOF
> File system has been set read-only"

I've found one problem with renaming over an existing file on vfat.
scandisk shows this up very nicely. Here is a patch that fixes that
problem for me. After applying this patch, scandisk no longer complains.

- Gordon

--- linux-2.1.75-clean/fs/vfat/namei.c Tue Dec 16 18:39:24 1997
+++ linux/fs/vfat/namei.c Mon Dec 22 23:27:41 1997
@@ -1518,7 +1518,7 @@
/* Is this the same file, different case? */
if (new_inode != old_inode) {
PRINTK(("vfat_rename 9\n"));
- res = vfat_unlinkx(new_dir,new_dentry,1);
+ res = vfat_unlink(new_dir,new_dentry);
PRINTK(("vfat_rename 10\n"));
if (res < 0) goto rename_done;
}