Whamcloud - gitweb
LU-6271 osc: faulty assertion in osc_object_prune() 27/16727/5
authorJinshan Xiong <jinshan.xiong@intel.com>
Tue, 6 Oct 2015 00:45:36 +0000 (17:45 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 24 Oct 2015 00:37:02 +0000 (00:37 +0000)
There may exist freeing pages in object's radix tree at
the time of osc_object_prune(), which causes failure at
the assertion of (osc->oo_npages == 0). This is a safe
race.

This problem is introduced in change at:
Lustre-commit: e8b421531c166b91ab5c1f417570c544bcdd050c
Lustre-change: http://review.whamcloud.com/16456

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I7d4e59bccfb012b870a2e8fa7ab99774def57349
Reviewed-on: http://review.whamcloud.com/16727
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osc/osc_cl_internal.h
lustre/osc/osc_object.c

index 7ca58c5..c386afa 100644 (file)
@@ -161,13 +161,13 @@ struct osc_object {
        /**
         * Radix tree for caching pages
         */
        /**
         * Radix tree for caching pages
         */
-       struct radix_tree_root  oo_tree;
        spinlock_t              oo_tree_lock;
        spinlock_t              oo_tree_lock;
+       struct radix_tree_root  oo_tree;
        unsigned long           oo_npages;
 
        /* Protect osc_lock this osc_object has */
        unsigned long           oo_npages;
 
        /* Protect osc_lock this osc_object has */
-       spinlock_t              oo_ol_spin;
        struct list_head        oo_ol_list;
        struct list_head        oo_ol_list;
+       spinlock_t              oo_ol_spin;
 
        /** number of active IOs of this object */
        atomic_t                oo_nr_ios;
 
        /** number of active IOs of this object */
        atomic_t                oo_nr_ios;
index 94b3cf5..8c27465 100644 (file)
@@ -214,10 +214,6 @@ static int osc_object_prune(const struct lu_env *env, struct cl_object *obj)
        struct osc_object       *osc = cl2osc(obj);
        struct ldlm_res_id      *resname = &osc_env_info(env)->oti_resname;
 
        struct osc_object       *osc = cl2osc(obj);
        struct ldlm_res_id      *resname = &osc_env_info(env)->oti_resname;
 
-       LASSERTF(osc->oo_npages == 0,
-                DFID "still have %lu pages, obj: %p, osc: %p\n",
-                PFID(lu_object_fid(&obj->co_lu)), osc->oo_npages, obj, osc);
-
        /* DLM locks don't hold a reference of osc_object so we have to
         * clear it before the object is being destroyed. */
        ostid_build_res_name(&osc->oo_oinfo->loi_oi, resname);
        /* DLM locks don't hold a reference of osc_object so we have to
         * clear it before the object is being destroyed. */
        ostid_build_res_name(&osc->oo_oinfo->loi_oi, resname);