fat [PATCH]

Andrzej Krzysztofowicz (ankry@green.mif.pg.gda.pl)
Mon, 16 Nov 1998 17:31:04 +0100 (CET)


Hi,
Sometimes when a romovable media (floppy) with fat filesystem and open
files on it is removed a KERNEL panic appears. I observed it in the case
when floppy, msdos & fat are all compiled as modules.
I think that a FILESYSTEM panic (and remounting r/o) is enough in that
case. And increase the whole system stability.

Cheers
Andrzej

--- linux/fs/fat/inode.c.old Thu Sep 10 23:32:26 1998
+++ linux/fs/fat/inode.c Sun Nov 15 13:43:04 1998
@@ -624,7 +624,8 @@
if (!(bh = fat_bread(sb, inode->i_ino >> MSDOS_DPB_BITS))) {
printk("dev = %s, ino = %ld\n",
kdevname(inode->i_dev), inode->i_ino);
- panic("fat_read_inode: unable to read i-node block");
+ fat_fs_panic(sb, "fat_read_inode: unable to read i-node block");
+ return;
}
raw_entry = &((struct msdos_dir_entry *) (bh->b_data))
[inode->i_ino & (MSDOS_DPB-1)];
@@ -713,7 +714,8 @@
if (!(bh = fat_bread(sb, inode->i_ino >> MSDOS_DPB_BITS))) {
printk("dev = %s, ino = %ld\n",
kdevname(inode->i_dev), inode->i_ino);
- panic("msdos_write_inode: unable to read i-node block");
+ fat_fs_panic(sb, "msdos_write_inode: unable to read i-node block");
+ return;
}
raw_entry = &((struct msdos_dir_entry *) (bh->b_data))
[inode->i_ino & (MSDOS_DPB-1)];

-- 
=======================================================================
  Andrzej M. Krzysztofowicz               ankry@mif.pg.gda.pl
  tel.  (0-58) 347 14 61
Wydz.Fizyki Technicznej i Matematyki Stosowanej Politechniki Gdanskiej

- 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/