Just build and try this small example. There are two pieces, some source in "mapit.c", and the script that uses it to demonstrate the problem, in "doit". If you place both of those in the same directory on an NFS partition, and run the script, you'll see output like: rm: cannot remove directory `dir': File exists rm: cannot unlink `dir/.nfs0001081d0000042f': Device or resource busy rm: cannot remove directory `dir': File exists It's the nfs_sillyrename() code that's creating that .nfs file. I understand its reason for existing. The only trouble is that the kernel doesn't realize that it can delete it in any kind of timely fashion. So, when a subsequent rmdir() is called on the parent directory, it fails. And to make matters worse, a subsequent rm -rf command fails (with EBUSY) trying to delete the .nfs file itself. =====mapit.c===== #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mman.h> main() { int fd; char* addr; fd = open("dir/file", O_RDWR|O_CREAT|O_TRUNC, 0666); ftruncate(fd, 4096); addr = mmap((void*)0, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); memset(addr, ' ', 4096); close(fd); } =====doit===== #!/bin/ksh # make -s mapit rm -rf dir 2>/dev/null if [ -d dir ]; then echo "... waiting for directory \"dir\" to clear out to re-run test ..." while [ -d dir ]; do rm -rf dir 2>/dev/null done fi mkdir -p dir ./mapit rm -rf dir || rm -rf dir
Thanks for the bug report. However, Red Hat no longer maintains this version of the product. Please upgrade to the latest version and open a new bug if the problem persists. The Fedora Legacy project (http://fedoralegacy.org/) maintains some older releases, and if you believe this bug is interesting to them, please report the problem in the bug tracker at: http://bugzilla.fedora.us/