Commit 88e4ff86 authored by Li Xi's avatar Li Xi Committed by Greg Kroah-Hartman

staging/lustre/ldlm: Hold lock when clearing flag

This patch moves lock's skip flag clearing from lru-delete to
lru-add code to prevent clearing lock's flag without resource lock
protection.
Signed-off-by: default avatarLi Xi <lixi@ddn.com>
Signed-off-by: default avatarBobi Jam <bobijam.xu@intel.com>
Reviewed-on: http://review.whamcloud.com/8772
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4269Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b3d0dfe5
...@@ -232,8 +232,6 @@ int ldlm_lock_remove_from_lru_nolock(struct ldlm_lock *lock) ...@@ -232,8 +232,6 @@ int ldlm_lock_remove_from_lru_nolock(struct ldlm_lock *lock)
LASSERT(lock->l_resource->lr_type != LDLM_FLOCK); LASSERT(lock->l_resource->lr_type != LDLM_FLOCK);
list_del_init(&lock->l_lru); list_del_init(&lock->l_lru);
if (lock->l_flags & LDLM_FL_SKIPPED)
lock->l_flags &= ~LDLM_FL_SKIPPED;
LASSERT(ns->ns_nr_unused > 0); LASSERT(ns->ns_nr_unused > 0);
ns->ns_nr_unused--; ns->ns_nr_unused--;
rc = 1; rc = 1;
...@@ -271,6 +269,8 @@ void ldlm_lock_add_to_lru_nolock(struct ldlm_lock *lock) ...@@ -271,6 +269,8 @@ void ldlm_lock_add_to_lru_nolock(struct ldlm_lock *lock)
LASSERT(list_empty(&lock->l_lru)); LASSERT(list_empty(&lock->l_lru));
LASSERT(lock->l_resource->lr_type != LDLM_FLOCK); LASSERT(lock->l_resource->lr_type != LDLM_FLOCK);
list_add_tail(&lock->l_lru, &ns->ns_unused_list); list_add_tail(&lock->l_lru, &ns->ns_unused_list);
if (lock->l_flags & LDLM_FL_SKIPPED)
lock->l_flags &= ~LDLM_FL_SKIPPED;
LASSERT(ns->ns_nr_unused >= 0); LASSERT(ns->ns_nr_unused >= 0);
ns->ns_nr_unused++; ns->ns_nr_unused++;
} }
......
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