NFSd: fix locking in nfsd_forget_delegations()
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Fri, 25 May 2012 14:38:50 +0000 (18:38 +0400)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 25 Jul 2012 13:18:27 +0000 (09:18 -0400)
commita6d88f293ecd1b7444e128777f4a893e7a998852
treecb8e65d7b24192bc8cdbe2afa4aad506c0e99db7
parent5559b50acdcdcad7e362882d3261bf934c9436f6
NFSd: fix locking in nfsd_forget_delegations()

This patch adds recall_lock hold to nfsd_forget_delegations() to protect
nfsd_process_n_delegations() call.
Also, looks like it would be better to collect delegations to some local
on-stack list, and then unhash collected list. This split allows to
simplify locking, because delegation traversing is protected by recall_lock,
when delegation unhash is protected by client_mutex.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c