Article View: comp.sys.sun
Article #12376automount and stale nfs handles
From: Ron Stanonik
Date: Thu, 27 Apr 1989 10:38
Date: Thu, 27 Apr 1989 10:38
56 lines
2157 bytes
2157 bytes
We're running sunos 4.0.1 on sun4's.
automounting home directories using an auto.home map seemed really neat,
but stale nfs handles (when the name expires from the cache) have made us
give up auto mounting homes (at least on the sun4's, sun386's seem okay).
Mush (a mail reader) is a good example of a program that suffers. Mush
opens a temp file (eg, /home/stanonik/.mush12345) to hold a copy of the
spool mail file. When new mail arrives, the temp file apparently is
opened for appending the new mail. If the name has expired however, the
open for appending fails due to "stale nfs handle". Not expecting this,
mush exits.
Oddly, this only seems to affect automounting from local filesystems.
For example, here's part of auto.home
stanonik atlantic:/home1/stanonik
For testing I'm automounting it on two suns atlantic and ranger
automount -m -tl 60 /home /etc/auto.home
To test this I'm using the following program
#include <fcntl.h>
extern int errno;
main(argc, argv)
int argc;
char **argv;
{
int fd;
argc--, argv++;
printf("opening %s\n", *argv);
if ((fd=open(*argv, O_RDONLY) < 0)) {
perror("first open");
exit(1);
}
sleep(70); /*let name expire*/
if (close(fd) < 0) {
perror("close");
exit(1);
}
printf("opening %s\n", *argv);
if ((fd=open(*argv, O_RDONLY) < 0)) {
perror("second open");
exit(1);
}
}
On atlantic and ranger I run "a.out /home/stanonik/blap". On atlantic the
second open barfs; on ranger the second open succeeds.
Maybe I'm doing something wrong?
Thanks,
Ron Stanonik
stanonik@nprdc.navy.mil
Technical Details
Message-ID:
<8904101748.AA21784@atlantic.nprdc.navy.mil>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-requestShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: stanonik@nprdc.navy.mil (Ron Stanonik) Newsgroups: comp.sys.sun Subject: automount and stale nfs handles Keywords: Networks Message-ID: <8904101748.AA21784@atlantic.nprdc.navy.mil> Date: 27 Apr 89 10:38:42 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 56 Approved: Sun-Spots@rice.edu Original-Date: 10 April 1989 1048-PDT (Monday) X-Sun-Spots-Digest: Volume 7, Issue 259, message 11 of 13