From f8549d4b7d3e8a5d607c94a0b1aee9f8d28d9f28 Mon Sep 17 00:00:00 2001 From: Dmitry Zogin Date: Fri, 15 Jan 2010 09:35:48 -0500 Subject: [PATCH] b=21565 filter_last_id() NULL dereference lprocfs_filter_rd_last_id() should check for the fully setup obd device, before proceeding further. i=johann i=andrew.perepechko --- lustre/obdfilter/filter.c | 1 + lustre/obdfilter/lproc_obdfilter.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 8c5c914..051b931 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -1337,6 +1337,7 @@ obd_id filter_last_id(struct filter_obd *filter, obd_gr group) obd_id id; LASSERT(filter->fo_fsd != NULL); LASSERT(group <= FILTER_GROUPS); + LASSERT(filter->fo_last_objids != NULL); /* FIXME: object groups */ spin_lock(&filter->fo_objidlock); diff --git a/lustre/obdfilter/lproc_obdfilter.c b/lustre/obdfilter/lproc_obdfilter.c index 44cfed1..35ee378 100644 --- a/lustre/obdfilter/lproc_obdfilter.c +++ b/lustre/obdfilter/lproc_obdfilter.c @@ -98,7 +98,7 @@ static int lprocfs_filter_rd_last_id(char *page, char **start, off_t off, { struct obd_device *obd = data; - if (obd == NULL) + if (obd == NULL || !obd->obd_set_up || obd->obd_stopping) return 0; return snprintf(page, count, LPU64"\n", -- 1.8.3.1