NLM: Always use AUTH_UNIX authentication for NLM locking. Most existing servers do not implement RPCSEC_GSS for either the lockd or statd daemons. Signed-off-by: Trond Myklebust --- fs/lockd/clntproc.c | 9 +-------- fs/lockd/host.c | 4 ++-- include/linux/lockd/lockd.h | 1 - 3 files changed, 3 insertions(+), 11 deletions(-) Index: linux-2.6.11-rc2/fs/lockd/host.c =================================================================== --- linux-2.6.11-rc2.orig/fs/lockd/host.c +++ linux-2.6.11-rc2/fs/lockd/host.c @@ -110,7 +110,6 @@ nlm_lookup_host(int server, struct socka host->h_addr.sin_port = 0; /* ouch! */ host->h_version = version; host->h_proto = proto; - host->h_authflavor = RPC_AUTH_UNIX; host->h_rpcclnt = NULL; init_MUTEX(&host->h_sema); host->h_nextrebind = jiffies + NLM_HOST_REBIND; @@ -191,8 +190,9 @@ nlm_bind_host(struct nlm_host *host) xprt_set_timeout(&xprt->timeout, 5, nlmsvc_timeout); + /* Existing NLM servers accept AUTH_UNIX only */ clnt = rpc_create_client(xprt, host->h_name, &nlm_program, - host->h_version, host->h_authflavor); + host->h_version, RPC_AUTH_UNIX); if (IS_ERR(clnt)) { xprt_destroy(xprt); goto forgetit; Index: linux-2.6.11-rc2/fs/lockd/clntproc.c =================================================================== --- linux-2.6.11-rc2.orig/fs/lockd/clntproc.c +++ linux-2.6.11-rc2/fs/lockd/clntproc.c @@ -329,7 +329,6 @@ nlmclnt_call(struct nlm_rqst *req, u32 p 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_message msg = { .rpc_argp = argp, .rpc_resp = resp, @@ -339,9 +338,6 @@ nlmclnt_call(struct nlm_rqst *req, u32 p dprintk("lockd: call procedure %d on %s\n", (int)proc, host->h_name); - if (filp) - msg.rpc_cred = nfs_file_cred(filp); - do { if (host->h_reclaiming && !argp->reclaim) goto in_grace_period; @@ -435,7 +431,6 @@ nlmclnt_async_call(struct nlm_rqst *req, struct rpc_clnt *clnt; struct nlm_args *argp = &req->a_args; struct nlm_res *resp = &req->a_res; - struct file *file = argp->lock.fl.fl_file; struct rpc_message msg = { .rpc_argp = argp, .rpc_resp = resp, @@ -450,11 +445,9 @@ nlmclnt_async_call(struct nlm_rqst *req, return -ENOLCK; msg.rpc_proc = &clnt->cl_procinfo[proc]; - /* bootstrap and kick off the async RPC call */ - if (file) - msg.rpc_cred = nfs_file_cred(file); /* Increment host refcount */ nlm_get_host(host); + /* bootstrap and kick off the async RPC call */ status = rpc_call_async(clnt, &msg, RPC_TASK_ASYNC, callback, req); if (status < 0) nlm_release_host(host); Index: linux-2.6.11-rc2/include/linux/lockd/lockd.h =================================================================== --- linux-2.6.11-rc2.orig/include/linux/lockd/lockd.h +++ linux-2.6.11-rc2/include/linux/lockd/lockd.h @@ -42,7 +42,6 @@ struct nlm_host { struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ char h_name[20]; /* remote hostname */ u32 h_version; /* interface version */ - rpc_authflavor_t h_authflavor; /* RPC authentication type */ unsigned short h_proto; /* transport proto */ unsigned short h_reclaiming : 1, h_server : 1, /* server side, not client side */