[comp.sys.sun] automount and stale nfs handles

stanonik@nprdc.navy.mil (Ron Stanonik) (04/27/89)

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