Commit 48e49187 authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Fix "EPIPE" error on mount of rpcsec_gss-protected partitions

 gss_create_upcall() should not error just because rpc.gssd closed the
 pipe on its end. Instead, it should requeue the pending requests and then
 retry.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 29884df0
...@@ -638,7 +638,7 @@ gss_pipe_destroy_msg(struct rpc_pipe_msg *msg) ...@@ -638,7 +638,7 @@ gss_pipe_destroy_msg(struct rpc_pipe_msg *msg)
gss_msg); gss_msg);
atomic_inc(&gss_msg->count); atomic_inc(&gss_msg->count);
gss_unhash_msg(gss_msg); gss_unhash_msg(gss_msg);
if (msg->errno == -ETIMEDOUT || msg->errno == -EPIPE) { if (msg->errno == -ETIMEDOUT) {
unsigned long now = jiffies; unsigned long now = jiffies;
if (time_after(now, ratelimit)) { if (time_after(now, ratelimit)) {
printk(KERN_WARNING "RPC: AUTH_GSS upcall timed out.\n" printk(KERN_WARNING "RPC: AUTH_GSS upcall timed out.\n"
...@@ -786,7 +786,9 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int taskflags) ...@@ -786,7 +786,9 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int taskflags)
cred->gc_flags = 0; cred->gc_flags = 0;
cred->gc_base.cr_ops = &gss_credops; cred->gc_base.cr_ops = &gss_credops;
cred->gc_service = gss_auth->service; cred->gc_service = gss_auth->service;
err = gss_create_upcall(gss_auth, cred); do {
err = gss_create_upcall(gss_auth, cred);
} while (err == -EAGAIN);
if (err < 0) if (err < 0)
goto out_err; goto out_err;
......
...@@ -174,7 +174,7 @@ rpc_pipe_release(struct inode *inode, struct file *filp) ...@@ -174,7 +174,7 @@ rpc_pipe_release(struct inode *inode, struct file *filp)
goto out; goto out;
msg = (struct rpc_pipe_msg *)filp->private_data; msg = (struct rpc_pipe_msg *)filp->private_data;
if (msg != NULL) { if (msg != NULL) {
msg->errno = -EPIPE; msg->errno = -EAGAIN;
list_del_init(&msg->list); list_del_init(&msg->list);
rpci->ops->destroy_msg(msg); rpci->ops->destroy_msg(msg);
} }
...@@ -183,7 +183,7 @@ rpc_pipe_release(struct inode *inode, struct file *filp) ...@@ -183,7 +183,7 @@ rpc_pipe_release(struct inode *inode, struct file *filp)
if (filp->f_mode & FMODE_READ) if (filp->f_mode & FMODE_READ)
rpci->nreaders --; rpci->nreaders --;
if (!rpci->nreaders) if (!rpci->nreaders)
__rpc_purge_upcall(inode, -EPIPE); __rpc_purge_upcall(inode, -EAGAIN);
if (rpci->ops->release_pipe) if (rpci->ops->release_pipe)
rpci->ops->release_pipe(inode); rpci->ops->release_pipe(inode);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment