Whamcloud - gitweb
LU-1421 clio: check cp_owner of cl_page after the page is owned
authorJinshan Xiong <jinshan.xiong@whamcloud.com>
Tue, 5 Jun 2012 04:32:02 +0000 (21:32 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 13 Jun 2012 21:18:59 +0000 (17:18 -0400)
After page writeback is supported in clio, there exists a short
period that page is unlocked but cp_owner is set. This confuses
the assertion of cl_page_assume(). This problem can be fixed by
checking cp_owner after the page is owned.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Change-Id: Iafcdbb9b0dbb5f081a84c1da1b7ad8051d406988
Reviewed-on: http://review.whamcloud.com/3027
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/cl_page.c

index c283b9a..217ee00 100644 (file)
@@ -1023,15 +1023,14 @@ EXPORT_SYMBOL(cl_page_own_try);
 void cl_page_assume(const struct lu_env *env,
                     struct cl_io *io, struct cl_page *pg)
 {
 void cl_page_assume(const struct lu_env *env,
                     struct cl_io *io, struct cl_page *pg)
 {
-        PASSERT(env, pg, pg->cp_owner == NULL);
         PINVRNT(env, pg, cl_object_same(pg->cp_obj, io->ci_obj));
         PINVRNT(env, pg, cl_object_same(pg->cp_obj, io->ci_obj));
-        PINVRNT(env, pg, cl_page_invariant(pg));
 
         ENTRY;
         pg = cl_page_top(pg);
         io = cl_io_top(io);
 
         cl_page_invoid(env, io, pg, CL_PAGE_OP(cpo_assume));
 
         ENTRY;
         pg = cl_page_top(pg);
         io = cl_io_top(io);
 
         cl_page_invoid(env, io, pg, CL_PAGE_OP(cpo_assume));
+        PASSERT(env, pg, pg->cp_owner == NULL);
         pg->cp_owner = io;
         pg->cp_task = current;
         cl_page_owner_set(pg);
         pg->cp_owner = io;
         pg->cp_task = current;
         cl_page_owner_set(pg);