From ee8b8845c03fb5a8c6b86732e4161d1a5e162fd6 Mon Sep 17 00:00:00 2001 From: jxiong Date: Thu, 16 Jul 2009 04:29:58 +0000 Subject: [PATCH] b=20148 r=eric.mei,rread Fixed a problem when a para-intialized lovsub object is freed --- lustre/lov/lovsub_object.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lustre/lov/lovsub_object.c b/lustre/lov/lovsub_object.c index c1bd3de..e8097e1 100644 --- a/lustre/lov/lovsub_object.c +++ b/lustre/lov/lovsub_object.c @@ -75,12 +75,17 @@ static void lovsub_object_free(const struct lu_env *env, struct lu_object *obj) { struct lovsub_object *los = lu2lovsub(obj); struct lov_object *lov = los->lso_super; + ENTRY; - LASSERT(lov->lo_type == LLT_RAID0); - LASSERT(lov->u.raid0.lo_sub[los->lso_index] == los); + /* We can't assume lov was assigned here, because of the shadow + * object handling in lu_object_find. + */ + if (lov) { + LASSERT(lov->lo_type == LLT_RAID0); + LASSERT(lov->u.raid0.lo_sub[los->lso_index] == los); + lov->u.raid0.lo_sub[los->lso_index] = NULL; + } - ENTRY; - lov->u.raid0.lo_sub[los->lso_index] = NULL; lu_object_fini(obj); lu_object_header_fini(&los->lso_header.coh_lu); OBD_SLAB_FREE_PTR(los, lovsub_object_kmem); -- 1.8.3.1