From: Dmitry Zogin Date: Mon, 25 Jan 2010 05:13:27 +0000 (-0500) Subject: b=21565 filter_last_id() NULL dereference X-Git-Tag: 1.10.0.36~27 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=72b7b6d3b380fc8c53f11cd3f17342bd6f5479cb 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 --- diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 94c66d6..19a359a 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -1424,6 +1424,7 @@ obd_id filter_last_id(struct filter_obd *filter, obd_gr group) obd_id id; LASSERT(filter->fo_fsd != NULL); LASSERT(group <= filter->fo_group_count); + LASSERT(filter->fo_last_objids != NULL); /* FIXME: object groups */ cfs_spin_lock(&filter->fo_objidlock); diff --git a/lustre/obdfilter/lproc_obdfilter.c b/lustre/obdfilter/lproc_obdfilter.c index 59b79e1..e49386e 100644 --- a/lustre/obdfilter/lproc_obdfilter.c +++ b/lustre/obdfilter/lproc_obdfilter.c @@ -101,7 +101,7 @@ static int lprocfs_filter_rd_last_id(char *page, char **start, off_t off, struct filter_obd *filter = &obd->u.filter; int retval = 0, rc, i; - if (obd == NULL) + if (obd == NULL || !obd->obd_set_up || obd->obd_stopping) return 0; rc = snprintf(page, count, LPU64"\n",filter_last_id(filter, 0)); if (rc < 0)