OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] NFSd: simplify locking in nfsd_recall_delegations()
[PATCH] NFSd: simplify locking in nfsd_recall_delegations() [message #46444] Tue, 22 May 2012 10:28 Go to next message
Stanislav Kinsbursky is currently offline  Stanislav Kinsbursky
Messages: 683
Registered: October 2011
Senior Member
Holding of client_mutex looks redundant here - holding of recall_lock looks
enough.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
---
fs/nfsd/nfs4state.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index f004e61..fdef9fc 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4744,11 +4744,9 @@ void nfsd_recall_delegations(u64 num)
{
unsigned int count;

- nfs4_lock_state();
spin_lock(&recall_lock);
count = nfsd_process_n_delegations(num, nfsd_break_one_deleg, NULL);
spin_unlock(&recall_lock);
- nfs4_unlock_state();

printk(KERN_INFO "NFSD: Recalled %d delegations", count);
}
Re: [PATCH] NFSd: simplify locking in nfsd_recall_delegations() [message #46755 is a reply to message #46444] Thu, 24 May 2012 12:30 Go to previous message
Benny Halevy is currently offline  Benny Halevy
Messages: 1
Registered: May 2012
Junior Member
On 2012-05-22 13:28, Stanislav Kinsbursky wrote:
> Holding of client_mutex looks redundant here - holding of recall_lock looks
> enough.

Looking at the code, agreed.

Benny

>
> Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
> ---
> fs/nfsd/nfs4state.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index f004e61..fdef9fc 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -4744,11 +4744,9 @@ void nfsd_recall_delegations(u64 num)
> {
> unsigned int count;
>
> - nfs4_lock_state();
> spin_lock(&recall_lock);
> count = nfsd_process_n_delegations(num, nfsd_break_one_deleg, NULL);
> spin_unlock(&recall_lock);
> - nfs4_unlock_state();
>
> printk(KERN_INFO "NFSD: Recalled %d delegations", count);
> }
>
> --
> 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
Previous Topic: [PATCH] NFSd: fix locking in nfsd_forget_delegations()
Next Topic: [PATCH v2 01/12] NFS: pass net to nfs_callback_down()
Goto Forum:
  


Current Time: Thu May 02 05:36:55 GMT 2024

Total time taken to generate the page: 0.01791 seconds