Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!convex!thurlow From: thurlow@convex.com (Robert Thurlow) Newsgroups: comp.protocols.nfs Subject: Re: Avoiding resource waits on unavailable hard mounted fs Message-ID: Date: 14 Feb 91 15:49:17 GMT References: <1991Feb14.035507.28805@massey.ac.nz> Sender: news@convex.com (news access account) Organization: Convex Computer Corporation, Richardson, Tx. Lines: 37 Nntp-Posting-Host: dhostwo.convex.com In <1991Feb14.035507.28805@massey.ac.nz> G.Eustace@massey.ac.nz (Glen Eustace) writes: >I am trying to write some code that will determine whether an NFS >mounted partition is currently accessible. The filesystem is hard >mounted and most file system will hang on a resource wait until such >time as the server is back up again. As this is part of a larger >program I don't want this to occur. Our df(1) does this now. I can't recall where the idea came from, but Tom Christiansen (tchrist@convex.com) put it into our code. The idea is to throw a packet at the null NFS procedure before trying an op which may hang. signal(SIGALRM, timedout); alarm(TIMEOUT); if(setjmp(env) == 0) { stat = callrpc(host, NFS_PROGRAM, NFS_VERSION, RFS_NULL, xdr_void, 0, xdr_void, 0); alarm(0); /* unimportant race condition here */ if (stat == 0) return 0; } After some experience with the automounter, I want to make a change to the kernel to permit me to set/clear a process flag to say, "I don't care if this is a hard mount or not, I want NFS operations to timeout; trust me, I can handle it." The automounter usually is a net benefit with dead servers, but if the server dies in the 5 minute window, the automounter can lock and take lots of processes with it. It's the most serious bug we have left with it right now, and probably needs the more aggressive fix. Rob T -- Rob Thurlow, thurlow@convex.com An employee and not a spokesman for Convex Computer Corp., Dallas, TX