From: Oleg Drokin Date: Sat, 2 Feb 2013 04:08:59 +0000 (-0500) Subject: LU-2654 ldlm: ldlm_resource_dump should be called with resource locked X-Git-Tag: 2.3.61~46 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=702258c220a8d9224413f259af4a21dda9950278;ds=inline 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 --- 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; }