aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-03-15 18:11:31 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-03-25 12:04:10 -0400
commit8c86899f62738b8a22ca3a5f060e269b92e5545a (patch)
tree91e5ddee636aad49c8440f81d14825bc1e460af2 /fs/nfs
parentc58c844187df61ef7cc103d0abb5dd6198bcfcd6 (diff)
NFS: __nfs_find_lock_context needs to check ctx->lock_context for a match too
Currently, we're forcing an unnecessary duplication of the initial nfs_lock_context in calls to nfs_get_lock_context, since __nfs_find_lock_context ignores the ctx->lock_context. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/inode.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 1f941674b089..55b840f05ab2 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -565,16 +565,17 @@ static void nfs_init_lock_context(struct nfs_lock_context *l_ctx)
565 565
566static struct nfs_lock_context *__nfs_find_lock_context(struct nfs_open_context *ctx) 566static struct nfs_lock_context *__nfs_find_lock_context(struct nfs_open_context *ctx)
567{ 567{
568 struct nfs_lock_context *pos; 568 struct nfs_lock_context *head = &ctx->lock_context;
569 struct nfs_lock_context *pos = head;
569 570
570 list_for_each_entry(pos, &ctx->lock_context.list, list) { 571 do {
571 if (pos->lockowner.l_owner != current->files) 572 if (pos->lockowner.l_owner != current->files)
572 continue; 573 continue;
573 if (pos->lockowner.l_pid != current->tgid) 574 if (pos->lockowner.l_pid != current->tgid)
574 continue; 575 continue;
575 atomic_inc(&pos->count); 576 atomic_inc(&pos->count);
576 return pos; 577 return pos;
577 } 578 } while ((pos = list_entry(pos->list.next, typeof(*pos), list)) != head);
578 return NULL; 579 return NULL;
579} 580}
580 581