Re: [PATCH] one of $BIGNUM devfs races

Alexander Viro (viro@math.psu.edu)
Tue, 7 Aug 2001 01:28:47 -0400 (EDT)


On Mon, 6 Aug 2001, Richard Gooch wrote:

> > It isn't. socket_i is used only in inodes allocated by sock_alloc().
> > It is not used in the inodes that live on any fs other than sockfs.
>
> OK. Although, where is sockfs?

net/socket.c. It's a pseudo-fs where all real sockets go. Nothing
spectacular - just a superblock + directory + bunch of dentries.
When we allocate a socket (socket(2), accept(2), socketpair(2), etc.)
its dentry is made a child of sockfs root and given the right name,
so that readlink on /proc/<pid>/fd/<n> would do the right thing
without any special-casing. Besides, we can get rid of checks for
inode->i_sb != NULL - it's _always_ non-NULL now (we have a similar
one for pipe(2)-created pipes). We also get pipe and socket struct file
out of the anonymous list - they live on the ->s_files of their
superblocks. Neither sockfs nor pipefs can be mounted by user, so it's
not visible to user, or, for that matter, to the rest of the kernel.
Some special-casing is gone - that's it.

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