Re: [PATCH 06/14] NFS: Treat NFS4ERR_CLID_INUSE as a fatal error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2012-07-09 at 16:12 -0400, Chuck Lever wrote:
> On Jul 9, 2012, at 4:10 PM, Myklebust, Trond wrote:
> 
> > On Mon, 2012-07-09 at 11:44 -0400, Chuck Lever wrote:
> >> For NFSv4 minor version 0, currently the cl_id_uniquifier allows the
> >> Linux client to generate a unique nfs_client_id4 string whenever a
> >> server replies with NFS4ERR_CLID_INUSE.
> >> 
> >> This implementation seems to be based on a flawed reading of RFC
> >> 3530.  NFS4ERR_CLID_INUSE actually means that the client has presented
> >> this nfs_client_id4 string with a different principal at some time in
> >> the past, and that lease is still in use on the server.
> >> 
> >> For a Linux client this might be rather difficult to achieve: the
> >> authentication flavor is named right in the nfs_client_id4.id
> >> string.  If we change flavors, we change strings automatically.
> >> 
> >> So, practically speaking, NFS4ERR_CLID_INUSE means there is some other
> >> client using our string.  There is not much that can be done to
> >> recover automatically.  Let's make it a permanent error.
> >> 
> >> Remove the recovery logic in nfs4_proc_setclientid(), and remove the
> >> cl_id_uniquifier field from the nfs_client data structure.  And,
> >> remove the authentication flavor from the nfs_client_id4 string.
> >> 
> >> Keeping the authentication flavor in the nfs_client_id4.id string
> >> means that we could have a separate lease for each authentication
> >> flavor used by mounts on the client.  But we want just one lease for
> >> all the mounts on this client.
> >> 
> >> Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
> >> ---
> >> 
> >> fs/nfs/nfs4proc.c         |   54 ++++++++++++++++++---------------------------
> >> fs/nfs/nfs4state.c        |    7 +++++-
> >> include/linux/nfs_fs_sb.h |    3 +--
> >> 3 files changed, 29 insertions(+), 35 deletions(-)
> >> 
> >> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> >> index 7adb705..63a3cf0 100644
> >> --- a/fs/nfs/nfs4proc.c
> >> +++ b/fs/nfs/nfs4proc.c
> >> @@ -259,7 +259,12 @@ static int nfs4_wait_clnt_recover(struct nfs_client *clp)
> >> 
> >> 	res = wait_on_bit(&clp->cl_state, NFS4CLNT_MANAGER_RUNNING,
> >> 			nfs_wait_bit_killable, TASK_KILLABLE);
> >> -	return res;
> >> +	if (res)
> >> +		return res;
> >> +
> >> +	if (clp->cl_cons_state < 0)
> >> +		return clp->cl_cons_state;
> >> +	return 0;
> >> }
> > 
> > A) This should be a separate patch.
> 
> OK.
> 
> > 
> > B) Why is it needed in the first place? All places that call
> > nfs4_wait_clnt_recover lie outside the mount code path.
> 
> The problem is that is no longer the case once we have trunking discovery in the mount path.
> 
> We discussed this.  This is what you told me to do.

The only new error condition your trunking detection is potentially
introducing here is CLID_INUSE. Why does that warrant this change?

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com

��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux