From 67c682b198f67248533452e347b9d84ca74d2505 Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Mon, 1 Jul 2013 00:38:23 -0400 Subject: [PATCH] LU-3521 clio: incorrect assertions in 'enable-invariants' Fixed several incorrect assumptions in 'enable-invariants'. Signed-off-by: Niu Yawei Change-Id: I0b54a26afe4e750ef887d0ca9786699bf0ca6ba2 Reviewed-on: http://review.whamcloud.com/6832 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Bobi Jam Reviewed-by: Jinshan Xiong Reviewed-by: Oleg Drokin --- lustre/obdclass/cl_page.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lustre/obdclass/cl_page.c b/lustre/obdclass/cl_page.c index acdb2e9..a05489f 100644 --- a/lustre/obdclass/cl_page.c +++ b/lustre/obdclass/cl_page.c @@ -514,7 +514,7 @@ static inline int cl_page_invariant(const struct cl_page *pg) child = pg->cp_child; owner = pg->cp_owner; - return cl_page_in_use(pg) && + return cl_page_in_use_noref(pg) && ergo(parent != NULL, parent->cp_child == pg) && ergo(child != NULL, child->cp_parent == pg) && ergo(child != NULL, pg->cp_obj != child->cp_obj) && @@ -863,7 +863,7 @@ void cl_page_disown0(const struct lu_env *env, ENTRY; state = pg->cp_state; PINVRNT(env, pg, state == CPS_OWNED || state == CPS_FREEING); - PINVRNT(env, pg, cl_page_invariant(pg)); + PINVRNT(env, pg, cl_page_invariant(pg) || state == CPS_FREEING); cl_page_owner_clear(pg); if (state == CPS_OWNED) @@ -1045,7 +1045,8 @@ EXPORT_SYMBOL(cl_page_unassume); void cl_page_disown(const struct lu_env *env, struct cl_io *io, struct cl_page *pg) { - PINVRNT(env, pg, cl_page_is_owned(pg, io)); + PINVRNT(env, pg, cl_page_is_owned(pg, io) || + pg->cp_state == CPS_FREEING); ENTRY; pg = cl_page_top(pg); -- 1.8.3.1