From e68d45b189b597a6eeba1cf7fff08831d9559dfa Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Fri, 15 Mar 2013 18:11:31 -0400 Subject: [PATCH] --- yaml --- r: 367277 b: refs/heads/master c: 8c86899f62738b8a22ca3a5f060e269b92e5545a h: refs/heads/master i: 367275: cd48b8036477fd8b5aaff1117f68c5b12b3e814d v: v3 --- [refs] | 2 +- trunk/fs/nfs/inode.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 80d8dd232b51..c7c83443762f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c58c844187df61ef7cc103d0abb5dd6198bcfcd6 +refs/heads/master: 8c86899f62738b8a22ca3a5f060e269b92e5545a diff --git a/trunk/fs/nfs/inode.c b/trunk/fs/nfs/inode.c index 1f941674b089..55b840f05ab2 100644 --- a/trunk/fs/nfs/inode.c +++ b/trunk/fs/nfs/inode.c @@ -565,16 +565,17 @@ static void nfs_init_lock_context(struct nfs_lock_context *l_ctx) static struct nfs_lock_context *__nfs_find_lock_context(struct nfs_open_context *ctx) { - struct nfs_lock_context *pos; + struct nfs_lock_context *head = &ctx->lock_context; + struct nfs_lock_context *pos = head; - list_for_each_entry(pos, &ctx->lock_context.list, list) { + do { if (pos->lockowner.l_owner != current->files) continue; if (pos->lockowner.l_pid != current->tgid) continue; atomic_inc(&pos->count); return pos; - } + } while ((pos = list_entry(pos->list.next, typeof(*pos), list)) != head); return NULL; }