X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=fs%2Fnfsd%2Fnfs4state.c;h=98aa7e8827b954d01829c6e8b090375b2156e248;hb=07cd4909a6c0c275ef42fd27748226975919e336;hp=dede43c373361849bf5fa2194be7f33266e0fc05;hpb=84d38ac9abf0a5bc0044c9363acaad55a9a4be0d;p=safe%2Fjmp%2Flinux-2.6 diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index dede43c..98aa7e8 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -632,6 +632,14 @@ free_session(struct kref *kref) static inline void renew_client_locked(struct nfs4_client *clp) { + if (is_client_expired(clp)) { + dprintk("%s: client (clientid %08x/%08x) already expired\n", + __func__, + clp->cl_clientid.cl_boot, + clp->cl_clientid.cl_id); + return; + } + /* * Move client to the end to the LRU list. */ @@ -697,6 +705,7 @@ free_client(struct nfs4_client *clp) static inline void unhash_client_locked(struct nfs4_client *clp) { + mark_client_expired(clp); list_del(&clp->cl_lru); while (!list_empty(&clp->cl_sessions)) { struct nfsd4_session *ses; @@ -740,8 +749,9 @@ expire_client(struct nfs4_client *clp) list_del(&clp->cl_strhash); spin_lock(&client_lock); unhash_client_locked(clp); + if (atomic_read(&clp->cl_refcount) == 0) + free_client(clp); spin_unlock(&client_lock); - free_client(clp); } static void copy_verf(struct nfs4_client *target, nfs4_verifier *source) @@ -827,6 +837,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir, } memcpy(clp->cl_recdir, recdir, HEXDIR_LEN); + atomic_set(&clp->cl_refcount, 0); atomic_set(&clp->cl_cb_set, 0); INIT_LIST_HEAD(&clp->cl_idhash); INIT_LIST_HEAD(&clp->cl_strhash); @@ -834,6 +845,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir, INIT_LIST_HEAD(&clp->cl_delegations); INIT_LIST_HEAD(&clp->cl_sessions); INIT_LIST_HEAD(&clp->cl_lru); + clp->cl_time = get_seconds(); clear_bit(0, &clp->cl_cb_slot_busy); rpc_init_wait_queue(&clp->cl_cb_waitq, "Backchannel slot table"); copy_verf(clp, verf);