Subject: NFSv3 deletion problem
To: None <current-users@NetBSD.ORG>
From: Aaron Brown <abrown@eecs.harvard.edu>
List: current-users
Date: 03/11/1996 21:27:51
Hi all,

I mentioned this earlier but got no response, and I can't send-pr it since
my only NetBSD machine doesn't yet have a reliably working sendmail...

Frequently since the NFS v3 integration, I've been getting lots and lots
of spurious .nfsXXXXXX files appearing in directories where I've been deleting
files. I know these are spurious since (1) I am the only user of the machine
and (2) there are no other processes running which could possibly have such
files open. It seems like somewhere the reference count to open files is 
not being maintained correctly, so when they're unlink()ed, the kernel
thinks they are still open and does the renaming/remapping. This happens 
with both a Solaris 2.4 server and a Network Appliance Box NFS server.

This seems to be most prevalent when I compile something complex...i.e. if
I compile TCL and then do a make clean, the make clean fails since it 
cannot remove certain directories it wants to remove since there are .nfsXXX
files populating them. It has also happened with heavy editing of files.

Similar symptoms occur when you delete an open file, then subsequently close
it: the temp. file doesn't go away. This is easily reproduced:

	% cd /usr/tmp
	% mkdir test
	% cd test
	% ls -l > test
	% vi test
	(^Z)
	% rm test
	% ls -a
	.               ..              .nfsA027b4.4	
	% fg
	(:q!)
	% ls -a
	.               ..              .nfsA027b4.4

I suspect the two problems are related somehow, and perhaps even by mmap
(doesn't vi mmap the file?).

I can not remove these .nfs files from the client, only from the server 
(which is kind of hard to do on the Network Appliance Box...)

I've glanced through nfs_vnops.c a bit without finding anything obviously
messed up.

Has anyone else seen this/know a fix? If not, could some kind soul try
to reproduce it and send-pr it for me so it has a chance of getting fixed?

--Aaron

--
Aaron B. Brown
abrown@eecs.harvard.edu