2021-11-15 20:58:39

by Olga Kornievskaia

[permalink] [raw]
Subject: [PATCH 1/1] NFSv4.1: handle NFS4ERR_NOSPC by CREATE_SESSION

From: Olga Kornievskaia <[email protected]>

When the client receives ERR_NOSPC on reply to CREATE_SESSION
it leads to a client hanging in nfs_wait_client_init_complete().
Instead, complete and fail the client initiation with an EIO
error which allows for the mount command to fail instead of
hanging.

Signed-off-by: Olga Kornievskaia <[email protected]>
---
fs/nfs/nfs4state.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index ecc4594299d6..50fa963665ba 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1998,6 +1998,10 @@ 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:
+ if (clp->cl_cons_state == NFS_CS_SESSION_INITING)
+ nfs_mark_client_ready(clp, -EIO);
+ return -EIO;
case -NFS4ERR_NOT_SAME: /* FixMe: implement recovery
* in nfs4_exchange_id */
default:
--
2.27.0



2021-11-15 20:58:39

by Trond Myklebust

[permalink] [raw]
Subject: Re: [PATCH 1/1] NFSv4.1: handle NFS4ERR_NOSPC by CREATE_SESSION

On Mon, 2021-11-15 at 15:18 -0500, Olga Kornievskaia wrote:
> From: Olga Kornievskaia <[email protected]>
>
> When the client receives ERR_NOSPC on reply to CREATE_SESSION
> it leads to a client hanging in nfs_wait_client_init_complete().
> Instead, complete and fail the client initiation with an EIO
> error which allows for the mount command to fail instead of
> hanging.
>
> Signed-off-by: Olga Kornievskaia <[email protected]>
> ---
>  fs/nfs/nfs4state.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
> index ecc4594299d6..50fa963665ba 100644
> --- a/fs/nfs/nfs4state.c
> +++ b/fs/nfs/nfs4state.c
> @@ -1998,6 +1998,10 @@ 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:

Shouldn't this be 'case -ENOSPC:'?

> +               if (clp->cl_cons_state == NFS_CS_SESSION_INITING)
> +                       nfs_mark_client_ready(clp, -EIO);
> +               return -EIO;
>         case -NFS4ERR_NOT_SAME: /* FixMe: implement recovery
>                                  * in nfs4_exchange_id */
>         default:

--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
[email protected]