diff mbox

[27/70] NFSd: Don't let the laundromat reap clients that are referenced

Message ID 1397846704-14567-28-git-send-email-trond.myklebust@primarydata.com (mailing list archive)
State New, archived
Headers show

Commit Message

Trond Myklebust April 18, 2014, 6:44 p.m. UTC
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/nfsd/nfs4state.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

J. Bruce Fields May 7, 2014, 7:20 p.m. UTC | #1
This looks redundant with the check just made in
mark_client_expired_locked().

--b.

On Fri, Apr 18, 2014 at 02:44:21PM -0400, Trond Myklebust wrote:
> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
> ---
>  fs/nfsd/nfs4state.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 273bdddb2458..41314e493110 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -3600,6 +3600,9 @@ nfs4_laundromat(struct nfsd_net *nn)
>  				clp->cl_clientid.cl_id);
>  			continue;
>  		}
> +		/* Hey, I'm busy with this guy! */
> +		if (atomic_read(&clp->cl_refcount) != 0)
> +			continue;
>  		list_move(&clp->cl_lru, &reaplist);
>  	}
>  	spin_unlock(&nn->client_lock);
> -- 
> 1.9.0
> 
--
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/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 273bdddb2458..41314e493110 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3600,6 +3600,9 @@  nfs4_laundromat(struct nfsd_net *nn)
 				clp->cl_clientid.cl_id);
 			continue;
 		}
+		/* Hey, I'm busy with this guy! */
+		if (atomic_read(&clp->cl_refcount) != 0)
+			continue;
 		list_move(&clp->cl_lru, &reaplist);
 	}
 	spin_unlock(&nn->client_lock);