Re: [broken] Re: [patch-2.4.0-test5-pre3] struct inode shortened

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Tue Jul 25 2000 - 19:42:29 EST


Tigran Aivazian wrote:
> Actually, the idea of union-ing things is probably broken anyway. Imagine
> clear_inode() is called on a pipe (because pipefs does iput(), e.g. from
> get_pipe_inode()):
>
> if (inode->i_bdev) {
> bdput(inode->i_bdev);
> inode->i_bdev = NULL;
> }
>
> in the union version, for a pipe, inode->i_bdev may well be not NULL and
> so bdput() will be called illegally. So, my yesterday's patch appears to
> be broken. (which is why I left Linus in cc to this message, I would not
> have wasted his time otherwise).

1. Make the name explicit: inode->i_union->bdev.

2. Change all the code that refers to the newly unioned fields.
   It should be clear from the name i_union that no code should
   read a field until it knows the type of the inode.

3. Do something similar for struct page. At least that would
   remove the ugly overloading of page->next_hash fields on the Sparc.

-- Jamie

-
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 : Mon Jul 31 2000 - 21:00:20 EST