diff mbox

[1/2] nfsv4: handle ENOSPC during create session

Message ID 1529598933-16506-1-git-send-email-manjunath.b.patil@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Manjunath Patil June 21, 2018, 4:35 p.m. UTC
Presently the client mount hangs for NFS4ERR_NOSPC repsonse from server
during create session operation. Handle this error at the client side
and pass it back to user-space, which may chose to mount with lower nfs
versions.

Signed-off-by: Manjunath Patil <manjunath.b.patil@oracle.com>
---
 fs/nfs/nfs4state.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Trond Myklebust June 21, 2018, 5:04 p.m. UTC | #1
On Thu, 2018-06-21 at 16:35 +0000, Manjunath Patil wrote:
> Presently the client mount hangs for NFS4ERR_NOSPC repsonse from

> server

> during create session operation. Handle this error at the client side

> and pass it back to user-space, which may chose to mount with lower

> nfs

> versions.

> 

> Signed-off-by: Manjunath Patil <manjunath.b.patil@oracle.com>

> ---

>  fs/nfs/nfs4state.c | 6 ++++++

>  1 file changed, 6 insertions(+)

> 

> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c

> index 2bf2eaa..2134cf5 100644

> --- a/fs/nfs/nfs4state.c

> +++ b/fs/nfs/nfs4state.c

> @@ -381,6 +381,8 @@ int nfs41_discover_server_trunking(struct

> nfs_client *clp,

>  	}

>  	nfs4_schedule_state_manager(clp);

>  	status = nfs_wait_client_init_complete(clp);

> +	if (!status) /* -ERESTARTSYS */

> +		status = nfs_client_init_status(clp);


Nack... The trunking code is _not_ the place to do session error
detection.

>  	if (status < 0)

>  		nfs_put_client(clp);

>  	return status;

> @@ -1919,6 +1921,9 @@ static int

> nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)

>  		dprintk("%s: exit with error %d for server %s\n",

>  				__func__, -EPROTONOSUPPORT, clp-

> >cl_hostname);

>  		return -EPROTONOSUPPORT;

> +	case -NFS4ERR_NOSPC:

> +		nfs_mark_client_ready(clp, status);

> +		/*fall through*/


Nack... This would cause existing mounts to suddenly permanently fail.

>  	case -NFS4ERR_NOT_SAME: /* FixMe: implement recovery

>  				 * in nfs4_exchange_id */

>  	default:

> @@ -2186,6 +2191,7 @@ int nfs4_discover_server_trunking(struct

> nfs_client *clp,

>  	case 0:

>  	case -EINTR:

>  	case -ERESTARTSYS:

> +	case -NFS4ERR_NOSPC:

>  		break;

>  	case -ETIMEDOUT:

>  		if (clnt->cl_softrtry)

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
Manjunath Patil June 22, 2018, 2:28 p.m. UTC | #2
Thank you for your comments Trond. Let me come back with better version.

-Thanks,
Manjunath
On 6/21/2018 10:04 AM, Trond Myklebust wrote:
> On Thu, 2018-06-21 at 16:35 +0000, Manjunath Patil wrote:
>> Presently the client mount hangs for NFS4ERR_NOSPC repsonse from
>> server
>> during create session operation. Handle this error at the client side
>> and pass it back to user-space, which may chose to mount with lower
>> nfs
>> versions.
>>
>> Signed-off-by: Manjunath Patil <manjunath.b.patil@oracle.com>
>> ---
>>   fs/nfs/nfs4state.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
>> index 2bf2eaa..2134cf5 100644
>> --- a/fs/nfs/nfs4state.c
>> +++ b/fs/nfs/nfs4state.c
>> @@ -381,6 +381,8 @@ int nfs41_discover_server_trunking(struct
>> nfs_client *clp,
>>   	}
>>   	nfs4_schedule_state_manager(clp);
>>   	status = nfs_wait_client_init_complete(clp);
>> +	if (!status) /* -ERESTARTSYS */
>> +		status = nfs_client_init_status(clp);
> Nack... The trunking code is _not_ the place to do session error
> detection.
>
>>   	if (status < 0)
>>   		nfs_put_client(clp);
>>   	return status;
>> @@ -1919,6 +1921,9 @@ static int
>> nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
>>   		dprintk("%s: exit with error %d for server %s\n",
>>   				__func__, -EPROTONOSUPPORT, clp-
>>> cl_hostname);
>>   		return -EPROTONOSUPPORT;
>> +	case -NFS4ERR_NOSPC:
>> +		nfs_mark_client_ready(clp, status);
>> +		/*fall through*/
> Nack... This would cause existing mounts to suddenly permanently fail.
>
>>   	case -NFS4ERR_NOT_SAME: /* FixMe: implement recovery
>>   				 * in nfs4_exchange_id */
>>   	default:
>> @@ -2186,6 +2191,7 @@ int nfs4_discover_server_trunking(struct
>> nfs_client *clp,
>>   	case 0:
>>   	case -EINTR:
>>   	case -ERESTARTSYS:
>> +	case -NFS4ERR_NOSPC:
>>   		break;
>>   	case -ETIMEDOUT:
>>   		if (clnt->cl_softrtry)

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 2bf2eaa..2134cf5 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -381,6 +381,8 @@  int nfs41_discover_server_trunking(struct nfs_client *clp,
 	}
 	nfs4_schedule_state_manager(clp);
 	status = nfs_wait_client_init_complete(clp);
+	if (!status) /* -ERESTARTSYS */
+		status = nfs_client_init_status(clp);
 	if (status < 0)
 		nfs_put_client(clp);
 	return status;
@@ -1919,6 +1921,9 @@  static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
 		dprintk("%s: exit with error %d for server %s\n",
 				__func__, -EPROTONOSUPPORT, clp->cl_hostname);
 		return -EPROTONOSUPPORT;
+	case -NFS4ERR_NOSPC:
+		nfs_mark_client_ready(clp, status);
+		/*fall through*/
 	case -NFS4ERR_NOT_SAME: /* FixMe: implement recovery
 				 * in nfs4_exchange_id */
 	default:
@@ -2186,6 +2191,7 @@  int nfs4_discover_server_trunking(struct nfs_client *clp,
 	case 0:
 	case -EINTR:
 	case -ERESTARTSYS:
+	case -NFS4ERR_NOSPC:
 		break;
 	case -ETIMEDOUT:
 		if (clnt->cl_softrtry)