From: Jinshan Xiong Date: Mon, 26 Mar 2012 19:17:17 +0000 (-0700) Subject: LU-1217 osc: to not check a cl_lock's state w/o protection X-Git-Tag: 2.1.2-RC1~44 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7d4a0e9564c759b558806d6be5394fa72ee85d31;p=fs%2Flustre-release.git LU-1217 osc: to not check a cl_lock's state w/o protection osc_page_putref_lock() used to check cl_lock's refcount and corresponding osc_lock's ols_hold without any protection, this is racy because other process can change the lock state so as to make the assertion be false. Signed-off-by: Jinshan Xiong Change-Id: I65fe1fa7fc55e8642fea6789784d7bb92a45d56f Reviewed-on: http://review.whamcloud.com/2604 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Niu Yawei Reviewed-by: Oleg Drokin --- diff --git a/lustre/osc/osc_page.c b/lustre/osc/osc_page.c index 0a3e480..a11a5b6 100644 --- a/lustre/osc/osc_page.c +++ b/lustre/osc/osc_page.c @@ -285,12 +285,6 @@ static void osc_page_putref_lock(const struct lu_env *env, cfs_atomic_dec(&olock->ols_pageref); opg->ops_lock = NULL; - /* - * Note: usually this won't be the last reference of the lock, but if - * it is, then all the lock_put do is at most just freeing some memory, - * so it would be OK that caller is holding spinlocks. - */ - LASSERT(cfs_atomic_read(&lock->cll_ref) > 1 || olock->ols_hold == 0); cl_lock_put(env, lock); }