Index: ufs/ufs/ufs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/ufs/ufs_vnops.c,v retrieving revision 1.158 diff -u -r1.158 ufs_vnops.c --- ufs/ufs/ufs_vnops.c 2001/02/23 20:06:01 1.158 +++ ufs/ufs/ufs_vnops.c 2001/03/13 06:09:07 @@ -700,6 +700,8 @@ goto out; } error = ufs_dirremove(dvp, ip, ap->a_cnp->cn_flags, 0); + if (ip->i_nlink <= 0) + vp->v_flag |= VNOSYNC; VN_KNOTE(vp, NOTE_DELETE); VN_KNOTE(dvp, NOTE_WRITE); out: Index: kern/vfs_subr.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_subr.c,v retrieving revision 1.305 diff -u -r1.305 vfs_subr.c --- kern/vfs_subr.c 2001/02/23 20:05:57 1.305 +++ kern/vfs_subr.c 2001/03/13 06:09:07 @@ -2593,6 +2597,9 @@ if (vp->v_flag & VXLOCK) /* XXX: what if MNT_WAIT? */ continue; + if (vp->v_flag & VNOSYNC) /* unlinked, skip it */ + continue; + if (flags != MNT_WAIT) { if (VOP_GETVOBJECT(vp, &obj) != 0 || (obj->flags & OBJ_MIGHTBEDIRTY) == 0) Index: sys/vnode.h =================================================================== RCS file: /home/ncvs/src/sys/sys/vnode.h,v retrieving revision 1.138 diff -u -r1.138 vnode.h --- sys/vnode.h 2001/03/06 17:28:24 1.138 +++ sys/vnode.h 2001/03/13 06:09:07 @@ -169,6 +169,7 @@ /* open for business 0x100000 */ #define VONWORKLST 0x200000 /* On syncer work-list */ #define VMOUNT 0x400000 /* Mount in progress */ +#define VNOSYNC 0x800000 /* Backing file unlinked, do not sync() */ /* * Vnode attributes. A field value of VNOVAL represents a field whose value