Re: [RFC] [PATCH 2/8] inode-diet: Move i_pipe into a union

Theodore Tso
2006-06-19T19:06:09Z

On Mon, Jun 19, 2006 at 07:19:26PM +0200, Jan Engelhardt wrote:
>
> >Move the i_pipe pointer into a union that will be shared with i_bdev
> >and i_cdev.
>
> >+ union {
> >+ struct pipe_inode_info *i_pipe;
> >+ };
>
> Since in the next patch you did
>
> - if (inode->i_bdev)
> + if (S_ISBLK(inode->i_mode) && inode->i_bdev)
>
> I am just asking, for clarity, if there were any similar lines for
> pipes that should now read S_IFIFO(inode->i_mode) too, like for bdevs.

Nope, I didn't see any, and I did audit all of the places that used
i_pipe. At least in the mainline kernel, all of the places which used
i_pipe were in places were we knew already that we were dealing with a
pipe.

As was mentioned in earlier comment, this will be problematic for the
out-of-tree System V Streams code, which hijacks i_pipe as another
place to store 4 bytes of random data needed for the Streams code (I
believe they needed a pointer to the stream head -- the v_str pointer
in a legacy Unix system's inode). But, that is an out-of-tree kernel
module, and it's a clear abuse of the i_pipe element in any case.

- Ted