Messages in this thread Patch in this message | | | Date | Fri, 05 Feb 1999 10:11:17 -0800 | From | "H.J. Lu" <> | Subject | Re: New kernel - netscape hangs |
| |
Alan Cox wrote:
> > > Ok I'll run a test on that. But it should be using NFS timeouts IMHO, thats > > > what BSD seems to do. > > > > Which BSD? > > SunOS 4.1.3 - if the lockd dies it waits, if the lockd is restored it comes back. > (its all I had handy) > > Ok. I still think it should wait - the patch looks fine for the non waiting case > and beats hanging forever
How about this patch instead? F_SETLKW will wait forever and F_SETLK will return an error?
H.J. Index: fs/lockd/clntproc.c =================================================================== RCS file: /local/work/cvs/linux/linux/fs/lockd/clntproc.c,v retrieving revision 1.1.1.8 diff -u -p -r1.1.1.8 clntproc.c --- clntproc.c 1999/01/27 00:29:00 1.1.1.8 +++ clntproc.c 1999/02/05 17:55:55 @@ -230,9 +230,24 @@ nlmclnt_call(struct nlm_rqst *req, u32 p /* Perform the RPC call. If an error occurs, try again */ if ((status = rpc_call(clnt, proc, argp, resp, 0)) < 0) { dprintk("lockd: rpc_call returned error %d\n", -status); - if (status == -ERESTARTSYS) - return status; - nlm_rebind_host(host); + switch (status) { + case -EPROTONOSUPPORT: + status = -EINVAL; + break; + case -ECONNREFUSED: + case -ETIMEDOUT: + case -ENOTCONN: + status = -EAGAIN; + break; + case -ERESTARTSYS: + return signalled () ? -EINTR : status; + default: + break; + } + if (req->a_args.block) + nlm_rebind_host(host); + else + break; } else if (resp->status == NLM_LCK_DENIED_GRACE_PERIOD) { dprintk("lockd: server in grace period\n"); @@ -248,9 +263,18 @@ nlmclnt_call(struct nlm_rqst *req, u32 p /* Back off a little and try again */ interruptible_sleep_on_timeout(&host->h_gracewait, 15*HZ); - } while (!signalled()); + + /* When the lock requested by F_SETLKW isn't available, + we will wait until the request can be satisfied. If + a signal is received during wait, we should return + -EINTR. */ + if (signalled ()) { + status = -EINTR; + break; + } + } while (1); - return -ERESTARTSYS; + return status; } /* Index: net/sunrpc/pmap_clnt.c =================================================================== RCS file: /local/work/cvs/linux/linux/net/sunrpc/pmap_clnt.c,v retrieving revision 1.1.1.3 diff -u -p -r1.1.1.3 pmap_clnt.c --- pmap_clnt.c 1997/10/25 04:26:38 1.1.1.3 +++ pmap_clnt.c 1999/01/27 23:36:35 @@ -121,7 +121,7 @@ pmap_getport_done(struct rpc_task *task) task->tk_action = NULL; } else if (clnt->cl_port == 0) { /* Program not registered */ - task->tk_status = -EACCES; + task->tk_status = -EPROTONOSUPPORT; task->tk_action = NULL; } else { /* byte-swap port number first */ | |