Re: Can't hardlink in different dirs. (BUG#826)

Alexander Viro (viro@math.psu.edu)
Sun, 5 Dec 1999 07:03:00 -0500 (EST)


On Fri, 3 Dec 1999, Pavel Machek wrote:

> Is not this bug of fuser? I mean, if someone has file opened, should
> not it be visible by fuser?

The whole point being that _nobody_ has it opened. It was attached to a
packet when sender called sendmsg(). That is, set of descriptors passed
by caller of sendmsg() had been converted into the set of struct file *
When recvmsg() is called by the receiving side this set is either dropped
(if caller of recvmsg() didn't expect files sent) or is passed into
receivers table of opened files. I.e. new descriptors are created and
files are attached to them. That's how it works. However, it happens only
when the packet is received. If the process sends it and closes his
descriptors - well, files are still alive (they are referenced from the
packet) but they do not belong to any process at that moment. Now, send
such packet to yourself and never call recvmsg(). And close the
descriptors.

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