Commit f2d39586 authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds
Browse files

[PATCH] knfsd: Fix two problems that can cause rmmod nfsd to die

Both cause the 'entries' count in the export cache to be non-zero at module
removal time, so unregistering that cache fails and results in an oops.

1/ exp_pseudoroot (used for NFSv4 only) leaks a reference to an export
2/ sunrpc_cache_update doesn't increment the entries count when it adds
   an entry.

Thanks to "david m.  richter" <> for triggering the
problem and finding one of the bugs.

Cc: "david m. richter" <>
Signed-off-by: default avatarNeil Brown <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent e46e4903
......@@ -1066,9 +1066,11 @@ exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp,
rv = nfserr_perm;
else if (IS_ERR(exp))
rv = nfserrno(PTR_ERR(exp));
else {
rv = fh_compose(fhp, exp,
fsid_key->ek_dentry, NULL);
cache_put(&fsid_key->h, &svc_expkey_cache);
return rv;
......@@ -159,6 +159,7 @@ struct cache_head *sunrpc_cache_update(struct cache_detail *detail,
detail->update(tmp, new);
tmp->next = *head;
*head = tmp;
is_new = cache_fresh_locked(tmp, new->expiry_time);
cache_fresh_locked(old, 0);
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