Commit fd699b8a authored by Jeff Layton's avatar Jeff Layton Committed by J. Bruce Fields

nfsd: don't destroy clients that are busy

It's possible that we'll have an in-progress call on some of the clients
while a rogue EXCHANGE_ID or DESTROY_CLIENTID call comes in. Be sure to
try and mark the client expired first, so that the refcount is
respected.

This will only be a problem once the client_mutex is removed.
Signed-off-by: default avatarJeff Layton <jlayton@primarydata.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent fb94d766
...@@ -2267,8 +2267,11 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, ...@@ -2267,8 +2267,11 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
/* case 1 (normal case) */ /* case 1 (normal case) */
out_new: out_new:
if (conf) if (conf) {
unhash_client_locked(conf); status = mark_client_expired_locked(conf);
if (status)
goto out;
}
new->cl_minorversion = cstate->minorversion; new->cl_minorversion = cstate->minorversion;
new->cl_mach_cred = (exid->spa_how == SP4_MACH_CRED); new->cl_mach_cred = (exid->spa_how == SP4_MACH_CRED);
...@@ -2881,6 +2884,9 @@ nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *csta ...@@ -2881,6 +2884,9 @@ nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *csta
status = nfserr_clientid_busy; status = nfserr_clientid_busy;
goto out; goto out;
} }
status = mark_client_expired_locked(conf);
if (status)
goto out;
clp = conf; clp = conf;
} else if (unconf) } else if (unconf)
clp = unconf; clp = unconf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment