Re: Oops trace for lockd (at last)

Trond Myklebust (trond.myklebust@fys.uio.no)
02 Sep 1999 01:47:24 +0200


"Steven N. Hirsch" <shirsch@adelphia.net> writes:

> Sep 1 18:43:40 pii kernel: [<c0116084>] [<c01583b3>] [<c015840a>] [<c018480d>] [<c0155dda>] [<c01089e7>]
> Sep 1 18:43:40 pii kernel: Code: 66 ff 40 08 8b 43 14 8b 4b 1c 8b 50 18 a1 40 68 21 c0 03 42
>
> >>EIP; c0183aac <rpcauth_holdcred+38/54> <=====
> Trace; c0154e81 <nlmclnt_async_call+95/ac>
> Trace; c015784c <nlmsvc_callback_exit+0/54>

Arrgh. Another 'nlmclnt_' misnomer. I didn't remember that
nlmclnt_async_call is used by the server code too when I put in the
fix for 'setuid' processes which inherit open files..

The appended patch should fix the Oops. I'm putting out patch version
0.11.8 now...

Cheers,
Trond

diff -u --recursive --new-file linux-2.2.12-nfsv3-orig/fs/lockd/clntproc.c linux-2.2.12-nfsv3/fs/lockd/clntproc.c
--- linux-2.2.12-nfsv3-orig/fs/lockd/clntproc.c Thu Sep 2 01:32:04 1999
+++ linux-2.2.12-nfsv3/fs/lockd/clntproc.c Thu Sep 2 01:23:57 1999
@@ -305,15 +305,14 @@
/*
* Generic NLM call, async version.
*/
-int
-nlmclnt_async_call(struct nlm_rqst *req, u32 proc, rpc_action callback)
+static int
+_nlmclnt_async_call(struct nlm_rqst *req, u32 proc, rpc_action callback,
+ struct rpc_cred *cred)
{
struct nlm_host *host = req->a_host;
struct rpc_clnt *clnt;
struct nlm_args *argp = &req->a_args;
struct nlm_res *resp = &req->a_res;
- struct file *filp = argp->lock.fl.fl_file;
- struct rpc_cred *cred = NULL;
int status;

dprintk("lockd: call procedure %s on %s (async)\n",
@@ -323,9 +322,6 @@
if ((clnt = nlm_bind_host(host)) == NULL)
return -ENOLCK;

- if (filp)
- cred = NFS_FILE_CRED(filp);
-
/* bootstrap and kick off the async RPC call */
status = rpc_do_call(clnt, cred, proc, argp, resp, RPC_TASK_ASYNC,
callback, req);
@@ -335,6 +331,27 @@
host->h_count++;
return status;
}
+
+
+int
+nlmclnt_async_call(struct nlm_rqst *req, u32 proc, rpc_action callback)
+{
+ struct nlm_args *argp = &req->a_args;
+ struct file *filp = argp->lock.fl.fl_file;
+ struct rpc_cred *cred = NULL;
+
+ if (filp)
+ cred = NFS_FILE_CRED(filp);
+
+ return _nlmclnt_async_call(req, proc, callback, cred);
+}
+
+int
+nlmsvc_async_call(struct nlm_rqst *req, u32 proc, rpc_action callback)
+{
+ return _nlmclnt_async_call(req, proc, callback, NULL);
+}
+

/*
* TEST for the presence of a conflicting lock
diff -u --recursive --new-file linux-2.2.12-nfsv3-orig/fs/lockd/svclock.c linux-2.2.12-nfsv3/fs/lockd/svclock.c
--- linux-2.2.12-nfsv3-orig/fs/lockd/svclock.c Thu Sep 2 01:32:04 1999
+++ linux-2.2.12-nfsv3/fs/lockd/svclock.c Thu Sep 2 01:13:17 1999
@@ -520,7 +520,7 @@
nlmsvc_insert_block(block, jiffies + 30 * HZ);

/* Call the client */
- nlmclnt_async_call(&block->b_call, NLMPROC_GRANTED_MSG,
+ nlmsvc_async_call(&block->b_call, NLMPROC_GRANTED_MSG,
nlmsvc_grant_callback);
up(&file->f_sema);
}
diff -u --recursive --new-file linux-2.2.12-nfsv3-orig/fs/lockd/svcproc.c linux-2.2.12-nfsv3/fs/lockd/svcproc.c
--- linux-2.2.12-nfsv3-orig/fs/lockd/svcproc.c Thu Sep 2 01:32:04 1999
+++ linux-2.2.12-nfsv3/fs/lockd/svcproc.c Thu Sep 2 01:13:56 1999
@@ -476,7 +476,7 @@
call->a_host = host;
memcpy(&call->a_args, resp, sizeof(*resp));

- if (nlmclnt_async_call(call, proc, nlmsvc_callback_exit) < 0)
+ if (nlmsvc_async_call(call, proc, nlmsvc_callback_exit) < 0)
return rpc_system_err;

return rpc_success;
diff -u --recursive --new-file linux-2.2.12-nfsv3-orig/include/linux/lockd/lockd.h linux-2.2.12-nfsv3/include/linux/lockd/lockd.h
--- linux-2.2.12-nfsv3-orig/include/linux/lockd/lockd.h Tue May 11 19:36:17 1999
+++ linux-2.2.12-nfsv3/include/linux/lockd/lockd.h Thu Sep 2 01:21:34 1999
@@ -144,6 +144,7 @@
/*
* Server-side lock handling
*/
+int nlmsvc_async_call(struct nlm_rqst *, u32, rpc_action);
u32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
struct nlm_lock *, int, struct nlm_cookie *);
u32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/