diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
| -rw-r--r-- | fs/nfs/nfs4proc.c | 18 | 
1 files changed, 17 insertions, 1 deletions
| diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 970f28dbf253..b1d2122bd5a7 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -671,6 +671,15 @@ nfs4_async_handle_exception(struct rpc_task *task, struct nfs_server *server,  	struct nfs_client *clp = server->nfs_client;  	int ret; +	if ((task->tk_rpc_status == -ENETDOWN || +	     task->tk_rpc_status == -ENETUNREACH) && +	    task->tk_flags & RPC_TASK_NETUNREACH_FATAL) { +		exception->delay = 0; +		exception->recovering = 0; +		exception->retry = 0; +		return -EIO; +	} +  	ret = nfs4_do_handle_exception(server, errorcode, exception);  	if (exception->delay) {  		int ret2 = nfs4_exception_should_retrans(server, exception); @@ -7074,10 +7083,18 @@ static struct nfs4_unlockdata *nfs4_alloc_unlockdata(struct file_lock *fl,  	struct nfs4_unlockdata *p;  	struct nfs4_state *state = lsp->ls_state;  	struct inode *inode = state->inode; +	struct nfs_lock_context *l_ctx;  	p = kzalloc(sizeof(*p), GFP_KERNEL);  	if (p == NULL)  		return NULL; +	l_ctx = nfs_get_lock_context(ctx); +	if (!IS_ERR(l_ctx)) { +		p->l_ctx = l_ctx; +	} else { +		kfree(p); +		return NULL; +	}  	p->arg.fh = NFS_FH(inode);  	p->arg.fl = &p->fl;  	p->arg.seqid = seqid; @@ -7085,7 +7102,6 @@ static struct nfs4_unlockdata *nfs4_alloc_unlockdata(struct file_lock *fl,  	p->lsp = lsp;  	/* Ensure we don't close file until we're done freeing locks! */  	p->ctx = get_nfs_open_context(ctx); -	p->l_ctx = nfs_get_lock_context(ctx);  	locks_init_lock(&p->fl);  	locks_copy_lock(&p->fl, fl);  	p->server = NFS_SERVER(inode); | 
