[lkml]   [1999]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] Re: FAT panic when renaming directories

On Sat, 27 Feb 1999, Brian Gerst wrote:

> I was renaming a bunch of directories on a FAT formatted ZIP disk when I
> got this message:
> Feb 27 08:14:59 citadel kernel: Filesystem panic (dev 08:04).
> Feb 27 08:14:59 citadel kernel: FAT error
> Feb 27 08:14:59 citadel kernel: File system has been set read-only
> Feb 27 08:14:59 citadel kernel: Directory 2444506: bad FAT
> This is with kernel 2.2.1. Any ideas about what could be happening?
> I'm pretty sure that the corruption is in the FAT filesystem because the
> ZIP is SCSI and the hd is IDE.

Aaaarrrrgh... Yes, it's VFAT and the bug is still present in 2.2.2. Patch

diff -urN linux-2.2.2/fs/vfat/namei.c linux-bird.vfat-fix/fs/vfat/namei.c
--- linux-2.2.2/fs/vfat/namei.c Thu Feb 25 10:03:57 1999
+++ linux-bird.vfat-fix/fs/vfat/namei.c Sun Feb 28 03:22:16 1999
@@ -1659,6 +1659,9 @@
res = vfat_remove_entry(new_dir,&sinfo,new_inode);
if (res)
goto rename_done;
+ if (is_dir)
+ new_dir->i_nlink--;

/* Serious lossage here. FAT uses braindead inode numbers scheme,
@@ -1669,9 +1672,6 @@
* in icache and as a part of stat output. It would kill all the
* 'busy' stuff on the spot. Later.
- if (is_dir)
- new_dir->i_nlink--;

res = vfat_find(new_dir,&new_dentry->d_name,1,is_dir,&sinfo);

Linus, apply it, please - it's a tail of the braino fixed back in
2.2.0-pre9. I've rechecked the thing now and there should be no stuff of
that sort left. It's commutative with the rename patch I've sent you.
Wearing the brown paperbag,

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:50    [W:0.046 / U:3.212 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site