From 702258c220a8d9224413f259af4a21dda9950278 Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Fri, 1 Feb 2013 23:08:59 -0500 Subject: [PATCH 1/1] LU-2654 ldlm: ldlm_resource_dump should be called with resource locked Fix ldlm_resource_complain to lock resource before calling ldlm_resource_dump Change-Id: I9dfbe84bd63de3093c99e7379daeca30d02fc875 Signed-off-by: Oleg Drokin Reviewed-on: http://review.whamcloud.com/5254 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Liang Zhen Reviewed-by: Oleg Drokin Tested-by: Oleg Drokin --- lustre/ldlm/ldlm_resource.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index 494661e..2174271 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -797,6 +797,7 @@ static int ldlm_resource_complain(cfs_hash_t *hs, cfs_hash_bd_t *bd, { struct ldlm_resource *res = cfs_hash_object(hs, hnode); + lock_res(res); CERROR("Namespace %s resource refcount nonzero " "(%d) after lock cleanup; forcing " "cleanup.\n", @@ -810,6 +811,7 @@ static int ldlm_resource_complain(cfs_hash_t *hs, cfs_hash_bd_t *bd, cfs_atomic_read(&res->lr_refcount) - 1); ldlm_resource_dump(D_ERROR, res); + unlock_res(res); return 0; } -- 1.8.3.1