Whamcloud - gitweb
b=21565 filter_last_id() NULL dereference
authorDmitry Zogin <dmitry.zogin@sun.com>
Mon, 25 Jan 2010 05:13:27 +0000 (00:13 -0500)
committerRobert Read <rread@sun.com>
Mon, 25 Jan 2010 18:48:48 +0000 (10:48 -0800)
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
lustre/obdfilter/lproc_obdfilter.c

index 94c66d6..19a359a 100644 (file)
@@ -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);
         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);
 
         /* FIXME: object groups */
         cfs_spin_lock(&filter->fo_objidlock);
index 59b79e1..e49386e 100644 (file)
@@ -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;
 
         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)
                 return 0;
         rc = snprintf(page, count, LPU64"\n",filter_last_id(filter, 0));
         if (rc < 0)