Commit 4e37a7c2 authored by Stanislav Kinsbursky's avatar Stanislav Kinsbursky Committed by J. Bruce Fields

nfsd: make delegations shutdown network namespace aware

NFSv4 delegations are stored in global list. But they are nfs4_client
dependent, which is network namespace aware already.
State shutdown and laundromat are done per network namespace as well.
So, delegations unhash have to be done in network namespace context.
Signed-off-by: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent c9a49628
...@@ -3230,6 +3230,8 @@ nfs4_laundromat(struct nfsd_net *nn) ...@@ -3230,6 +3230,8 @@ nfs4_laundromat(struct nfsd_net *nn)
spin_lock(&recall_lock); spin_lock(&recall_lock);
list_for_each_safe(pos, next, &del_recall_lru) { list_for_each_safe(pos, next, &del_recall_lru) {
dp = list_entry (pos, struct nfs4_delegation, dl_recall_lru); dp = list_entry (pos, struct nfs4_delegation, dl_recall_lru);
if (net_generic(dp->dl_stid.sc_client->net, nfsd_net_id) != nn)
continue;
if (time_after((unsigned long)dp->dl_time, (unsigned long)cutoff)) { if (time_after((unsigned long)dp->dl_time, (unsigned long)cutoff)) {
u = dp->dl_time - cutoff; u = dp->dl_time - cutoff;
if (test_val > u) if (test_val > u)
...@@ -4922,6 +4924,8 @@ __nfs4_state_shutdown(struct net *net) ...@@ -4922,6 +4924,8 @@ __nfs4_state_shutdown(struct net *net)
spin_lock(&recall_lock); spin_lock(&recall_lock);
list_for_each_safe(pos, next, &del_recall_lru) { list_for_each_safe(pos, next, &del_recall_lru) {
dp = list_entry (pos, struct nfs4_delegation, dl_recall_lru); dp = list_entry (pos, struct nfs4_delegation, dl_recall_lru);
if (dp->dl_stid.sc_client->net != net)
continue;
list_move(&dp->dl_recall_lru, &reaplist); list_move(&dp->dl_recall_lru, &reaplist);
} }
spin_unlock(&recall_lock); spin_unlock(&recall_lock);
......
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