Subject: CVS commit: syssrc
To: None <source-changes@netbsd.org>
From: Bill Sommerfeld <sommerfeld@netbsd.org>
List: source-changes
Date: 08/01/1999 16:16:36
Module Name:	syssrc
Committed By:	sommerfeld
Date:		Sun Aug  1 23:16:35 UTC 1999

Modified Files:
	syssrc/sys/miscfs/union: union_subr.c union_vnops.c

Log Message:
Fix PR4439: directory link count in unions where only upper directory
exists is bogus.  The goal here is to produce a synthetic link count
which won't confuse fts and similar routines which "know" that
directories with a link count of 2 don't have subdirectories (and
thus, they can avoid having to stat every entry in the directory
looking for subdirectories which aren't there).

We know that non-UNIX filesystem implementations may return a link
count of `1' for directories with an indeterminate number of
subdirectories; if either the upper or lower layer returns a link
count of `1', return a link count of 1.  If both layers return a link
count of 2, return a link count of 2; otherwise, return the sum of the
link count of both layers.

Also, fix PR7430: unionfs ignores read-only mounts.  Check for
MNT_RDONLY in union_lookup (more-or-less as in layer_lookup) as well
as union_access() and union_setattr().

Note that a read-only union layer may still cause side effects on the
underlying filesystems...  Most notably, we'll still attempt to create
shadow directories in the upper layer.  Also, of course, we'll
side-effect atimes in the lower layer.


To generate a diff of this commit:
cvs rdiff -r1.34 -r1.35 syssrc/sys/miscfs/union/union_subr.c
cvs rdiff -r1.45 -r1.46 syssrc/sys/miscfs/union/union_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.