From b4aad0cdc53c625241d7de7a2bbcb7feaee5263d Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Mon, 8 Oct 2012 13:23:03 +0800 Subject: [PATCH] LU-1842 oi: handle failure cases for osd_oi_fini Sometimes the osd_oi_fini() may be called without osd_oi_init() called firstly, or with osd_oi_init() failure. Under such cases, the osd_device::od_oi_table may be invalid, so just skip related OI cleanup. Signed-off-by: Fan Yong Change-Id: I67156acbe235287e8fc98606b0449998ef6f9dd0 Reviewed-on: http://review.whamcloud.com/4218 Reviewed-by: Johann Lombardi Reviewed-by: Liang Zhen Tested-by: Hudson Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/osd-ldiskfs/osd_oi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lustre/osd-ldiskfs/osd_oi.c b/lustre/osd-ldiskfs/osd_oi.c index 8358a13..cc69ca9 100644 --- a/lustre/osd-ldiskfs/osd_oi.c +++ b/lustre/osd-ldiskfs/osd_oi.c @@ -419,6 +419,9 @@ out: void osd_oi_fini(struct osd_thread_info *info, struct osd_device *osd) { + if (unlikely(osd->od_oi_table == NULL)) + return; + osd_oi_table_put(info, osd->od_oi_table, osd->od_oi_count); OBD_FREE(osd->od_oi_table, -- 1.8.3.1