From c5e84d53198142919b526fd304c6782005e38bdb Mon Sep 17 00:00:00 2001 From: Jinshan Xiong Date: Mon, 5 Oct 2015 17:45:36 -0700 Subject: [PATCH] LU-6271 osc: faulty assertion in osc_object_prune() 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 Change-Id: I7d4e59bccfb012b870a2e8fa7ab99774def57349 Reviewed-on: http://review.whamcloud.com/16727 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- lustre/osc/osc_cl_internal.h | 4 ++-- lustre/osc/osc_object.c | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lustre/osc/osc_cl_internal.h b/lustre/osc/osc_cl_internal.h index 7ca58c5..c386afa 100644 --- a/lustre/osc/osc_cl_internal.h +++ b/lustre/osc/osc_cl_internal.h @@ -161,13 +161,13 @@ struct osc_object { /** * Radix tree for caching pages */ - struct radix_tree_root oo_tree; spinlock_t oo_tree_lock; + struct radix_tree_root oo_tree; unsigned long oo_npages; /* Protect osc_lock this osc_object has */ - spinlock_t oo_ol_spin; struct list_head oo_ol_list; + spinlock_t oo_ol_spin; /** number of active IOs of this object */ atomic_t oo_nr_ios; diff --git a/lustre/osc/osc_object.c b/lustre/osc/osc_object.c index 94b3cf5..8c27465 100644 --- a/lustre/osc/osc_object.c +++ b/lustre/osc/osc_object.c @@ -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; - 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); -- 1.8.3.1