On Sun, 6 Aug 2000, Tigran Aivazian wrote:
> Hi Alexander,
>
> I have just found an interesting bug. Try mounting read/write a
> write-protected floppy in 2.4.0-test6-pre5 (probably also other
> kernels). The oops is attached.
>
> The reason is quite clear. When blkdev_get() calls block device open
> routine it passes a fake_inode as 'inode' argument and therefore it's
> inode->i_sb is not set because it is not known yet (sb=read_super()
> happens later than blkdev_get() in get_sb_bdev()). Now, the device open
> routine, for example drivers/block/floppy.c:floppy_open() is free to call
> permission(inode, mask) on that inode which will in turn do
> IS_RDONLY(inode) which dereferences inode->i_sb->s_flags off NULL
> inode->i_sb - hence the oops.
>
> So, it looks like to get a bdev we need to blkdev_get it which needs a
> superblock but to get a superblock we need a bdev. What do we do?
>
> Regards,
> Tigran
>
-
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/