Re: [2.4.10-pre11 OOPS] in do_generic_file_read

Paul Mackerras (paulus@samba.org)
Wed, 19 Sep 2001 18:43:02 +1000 (EST)


Nick Piggin writes:

> I got the following oops on startup while mounting the root filesystem.
> Unfortunately there was no "Code" because of a bad EIP value. If anyone
> would like more information or anything for me to test, please CC me.

I got something similar. I would predict that you are using devfs.
The problem is that devfs doesn't set inode->i_mapping->a_ops for a
block device. Ext2 (for instance) calls init_special_inode, and pre11
added a line to that procedure to initialize that field. But devfs
doesn't use init_special_inode.

The patch below fixes the problem for me. It may be that devfs should
be calling init_special_inode instead, but that sets inode->i_fop as
well and it looks like devfs sets that a bit differently. Richard?

Paul.

diff -urN linux/fs/devfs/base.c pmac/fs/devfs/base.c
--- linux/fs/devfs/base.c Wed Sep 19 16:39:20 2001
+++ pmac/fs/devfs/base.c Wed Sep 19 17:11:01 2001
@@ -2286,6 +2286,7 @@
}
else printk ("%s: read_inode(%d): no block device from bdget()\n",
DEVFS_NAME, (int) inode->i_ino);
+ inode->i_mapping->a_ops = &def_blk_aops;
}
else if ( S_ISFIFO (de->inode.mode) ) inode->i_fop = &def_fifo_fops;
else if ( S_ISREG (de->inode.mode) ) inode->i_size = de->u.fcb.u.file.size;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/