Subject: CVS commit: src
To: None <source-changes@netbsd.org>
From: Bill Sommerfeld <sommerfeld@netbsd.org>
List: source-changes
Date: 03/22/1999 09:24:23
Module Name:	src
Committed By:	sommerfeld
Date:		Mon Mar 22 17:24:23 UTC 1999

Modified Files:
	src/sys/kern: vfs_subr.c
	src/sys/miscfs/nullfs: null_vnops.c
	src/sys/miscfs/umapfs: umap_vnops.c
	src/sys/miscfs/union: union_vnops.c
Log Message:
vinvalbuf, called from vclean, could cause a locking-against-self
deadlock in VOP_FSYNC() if the unreferenced vnode picked for
reclamation happened to be stacked on top of a vnode the process
already had locked.  This could happen if the same filesystem was
accessed both through a union mount and directly; it seemed to happen
most frequently when the direct access was through NFS.

Avoid this deadlock by changing vinvalbuf to pass a new FSYNC_RECLAIM
flag bit to VOP_FSYNC() to indicate that a reclaim is in progress and
only a `shallow' fsync is necessary.

Do nothing in *_fsync() in umapfs, nullfs, and unionfs when
FSYNC_RECLAIM is set; the underlying vnodes will shortly be released
in *_reclaim and may be reclaimed (and fsync'ed) later.