Re: init_special_inode in 2.3.35

From: Alexander Viro (viro@math.psu.edu)
Date: Tue Jan 11 2000 - 03:07:46 EST


On Mon, 10 Jan 2000, David Grothe wrote:

> In kernel version 2.3.35 the routine ext2_read_inode in fs/ext2/inode.c
> reads in the "i_data" from the disk copy of the inode even for character
                                ^^^^^^
                                already brought in-core.
> special devices. Version 2.2.13 did not do this.
>
> For character special devices it then calls the routine
> init_special_inode in fs/devices.c. This routine does not store
> anything into the inode field u.generic_ip. As a consequence, this
> field is non-zero when the character mode driver's open routine gets
> called. Not good.

> The attached patch fixes the problem.

What problem? If your driver uses u.generic_ip you are screwed. Really. On
a lot of filesystems this field is _used_. The fact that by accident ext2
and minix have those bytes of struct inode unused (in case of devices) is
just that - accident. Your "fix" breaks procfs, it breaks umsdos, hpfs and
IIRC NFS. Fix your driver. _All_ ->u is off-limits for any device code. It
belongs to hosting filesystem and to nobody else.

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



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:17 EST