freebsd-nq/sys/fs/nullfs
Konstantin Belousov 140dedb81c The r241025 fixed the case when a binary, executed from nullfs mount,
was still possible to open for write from the lower filesystem.  There
is a symmetric situation where the binary could already has file
descriptors opened for write, but it can be executed from the nullfs
overlay.

Handle the issue by passing one v_writecount reference to the lower
vnode if nullfs vnode has non-zero v_writecount.  Note that only one
write reference can be donated, since nullfs only keeps one use
reference on the lower vnode.  Always use the lower vnode v_writecount
for the checks.

Introduce the VOP_GET_WRITECOUNT to read v_writecount, which is
currently always bypassed to the lower vnode, and VOP_ADD_WRITECOUNT
to manipulate the v_writecount value, which manages a single bypass
reference to the lower vnode.  Caling the VOPs instead of directly
accessing v_writecount provide the fix described in the previous
paragraph.

Tested by:	pho
MFC after:	3 weeks
2012-11-02 13:56:36 +00:00
..
null_subr.c Allow shared lookups for nullfs mounts, if lower filesystem supports 2012-09-09 19:20:23 +00:00
null_vfsops.c Allow shared lookups for nullfs mounts, if lower filesystem supports 2012-09-09 19:20:23 +00:00
null_vnops.c The r241025 fixed the case when a binary, executed from nullfs mount, 2012-11-02 13:56:36 +00:00
null.h Allow shared lookups for nullfs mounts, if lower filesystem supports 2012-09-09 19:20:23 +00:00