Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Sep 2011 17:32:27 +0200
From:      Robert Millan <rmh@freebsd.org>
To:        FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org
Cc:        Kostik Belousov <kostikbel@gmail.com>, Josef Karthauser <joe@freebsd.org>, Adrian Chadd <adrian@freebsd.org>, freebsd-fs@freebsd.org
Subject:   Re: kern/159663: sockets don't work though nullfs mounts
Message-ID:  <CAOfDtXMtqd8WonbdwBWL1vaFNte47G-Qo4JAskgM0Y99Ru6U2g@mail.gmail.com>
In-Reply-To: <CAOfDtXM45OT-aZ71-=JE7ZaG4%2B4Db1y4poO9L%2BePZW2%2BAMFXXg@mail.gmail.com>
References:  <201108102152.p7ALqUl4075207@red.freebsd.org> <201108102200.p7AM0Nu9026320@freefall.freebsd.org> <CAOfDtXMa6r%2BK5ZmTfuKV5qXNOoqS7kJvRhy4W%2B0jwBhFqfk1PQ@mail.gmail.com> <CAOfDtXM45OT-aZ71-=JE7ZaG4%2B4Db1y4poO9L%2BePZW2%2BAMFXXg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2011/9/24 Robert Millan <rmh@freebsd.org>:
> I found a thread from 2007 with further discussion about this problem:
>
> http://lists.freebsd.org/pipermail/freebsd-fs/2007-February/002669.html

Hi,

I've looked at the situation in a bit more detail, for now only with
sockets in mind (not named pipes).  My understanding is (please
correct me if I'm wrong):

- nullfs holds reference counts for each vnode, but sockets have their
own mechanism for reference counting (so_count / soref / sorele).
vnode reference counting doesn't protect against socket being closed,
which would leave a stale pointer in the upper nullfs layer.

- Increasing the reference count of the socket itself can't be done in
null_nodeget() because this function is merely a getter whose call
doesn't indicate any meaningful event.

- It's not clear to me that there's any event in time where the socket
reference can be increased.  If mounting a nullfs were that event,
then all existing sockets would be soref'ed but we wouldn't be
soref'ing future sockets created in the lower layer after the mount.
This doesn't seem correct.

- Possible solution: null_nodeget() semantics are replaced with
something that actually allows vnodes in the upper layer to be created
and destroyed.

- Possible solution: upper layer has a memory structure to keep track
of which sockets in the lower layer have been soref'ed.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOfDtXMtqd8WonbdwBWL1vaFNte47G-Qo4JAskgM0Y99Ru6U2g>