1.3.77: NFS directory cache bug

Rogier Wolff (rhdv@beatrix.fss.fokker.nl)
Fri, 22 Mar 1996 08:54:43 +0100 (MET)


I have found that a deleted directory on an NFS mounted file system
stays somewhat readable and you can make it your current
directory. Only when you try to create a file in the deleted
directory, the true nature becomes visible.
A short look at the NFS code shows that no revalidation is done when
reading a directory, in contrast with reading a file.
The NFS server is a SUN SPARC running SunOS 4.1.2.

Repeat by:

ahost:~$ mkdir foo
bhost:~$ cd foo
linux:~$ cd foo
ahost:~$ rmdir foo
linux:~/foo$ ls -a
bhost:~/foo$ ls
ls: .: Stale NFS file handle
linux:~/foo$ touch bar
touch: foo: Stale NFS file handle
linux:~/foo$ ls -la
total 0
linux:~/foo$ cd ..
linux:~$ uname -a
Linux hobbes 1.3.72 #5 Fri Mar 8 17:46:01 MET 1996 i586

ahost: any machine (Linux, SunOS, IRIX)
bhost: a computer running either SunOS or IRIX.

The kernel shows this behaviour at least since version 1.3.69.

Robert

-- 
Robert H. de Vries
Simulation and Robotics
Fokker Space B.V.
e-mail: rhdv@fss.fokker.nl
   tel: (+31)71-5245464
   fax: (+31)71-5245498