SUMMARY: Stale NFS file handle

From: Kevin Hammond (venus!hammond@sunloop.Central.Sun.COM)
Date: Sun Jan 17 1993 - 18:59:22 CST


Here is my original posting:

> We mount /cdrom from an SLC NFS server. If we change the CD in the drive
> on the server and the attempt to access /cdrom from one of the clients,
> the client will receive "Stale NFS file handle". We have to remount /cdrom
> on all of the clients before they will be able to see what's in /cdrom.

> Should it work this way?

The replies I have received have indicated this is proper behavior. Some
have suggested using the automounter to circumvent the problem. I have not
yet had a chance to test this. When I do, I will post the results. Here
are some of the replies I received:

> The problem is that the clients may be holding onto "file handles" for
> files on the old CD-ROM, including a "file handle" for the root
> directory of the CD-ROM; if you change the CD-ROM out from under them,
> those "file handles" no longer refer to what they referred to before you
> changed the CD-ROM, and are thus "stale".

> before changing the cd, you need to umount /cdrom. After loading
> the new one in, you need to mount /cdrom. This should solve your
> prob :)

> It is supposed to work this way.
> You are playing dangerous games here: what happens if you unmount
> the CD filesystem when somebody is using it? My experience is you can crash
> your server this way.
>
> The NFS 'opaque handle' (see NFS RFC) is also based on the filesystem you mount.
> If you change it, you get stale file handle, or a crash. be aware!

> What your attempting to do will not work. The clients get a snapshot
> of various parts of the real disk through the NFS mapping. When you
> unmount the cd and mount a new one, you change the mapping. A
> possible solution for you to look at would be to use the automounter
> to nfs mount the cdrom on the clients. You might also have to change
> the mount procedure on the "server".
> 1. umount /cdrom
> 2. change cd's
> 3. mount /cdrom
> 4. exportfs -av <<<<< this is needed to tell NFS to reexport the new
> mount.

> That's exactly how it should work. You're changing the media out from
> under the mount. You must dismount all clients, dismount the local
> CD, change the disk, mount the local CD, and remount the clients, for
> this to work properly. Remember that you're mounting the CD, not the
> CD drive.

Thanks to the following people:

auspex.com!guy
turtle.ncsa.uiuc.edu!robm
qualcomm.com!kbibb
ica.philips.nl!geertj
antares.mcs.anl.gov!rackow
hyphen.com!dwight
turtle.ncsa.uiuc.edu!robm
vest.sdata.no!birger

--
Kevin W. Hammond			email: sunloop!venus!hammond
Imaging Development			Voice: (312) 223-3373
Chicago Title & Trust			  FAX: (312) 223-5945



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:07:23 CDT