[PATCH 03/26] staging/lustre/clio: incorrect assertions in 'enable-invariants'

From: Peng Tao
Date: Thu Nov 14 2013 - 11:44:13 EST


From: Niu Yawei <yawei.niu@xxxxxxxxx>

Fixed several incorrect assumptions in 'enable-invariants'.

Lustre-change: http://review.whamcloud.com/6832
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3521
Signed-off-by: Niu Yawei <yawei.niu@xxxxxxxxx>
Reviewed-by: Bobi Jam <bobijam@xxxxxxxxx>
Reviewed-by: Jinshan Xiong <jinshan.xiong@xxxxxxxxx>
Reviewed-by: Oleg Drokin <oleg.drokin@xxxxxxxxx>
Signed-off-by: Peng Tao <bergwolf@xxxxxxxxx>
Signed-off-by: Andreas Dilger <andreas.dilger@xxxxxxxxx>
---
drivers/staging/lustre/lustre/obdclass/cl_page.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index 2a5ce37..d997c8e 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -481,7 +481,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) &&
@@ -814,7 +814,7 @@ void cl_page_disown0(const struct lu_env *env,

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)
@@ -989,7 +989,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);

pg = cl_page_top(pg);
io = cl_io_top(io);
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/