Whamcloud - gitweb
LU-106 procfs: many proc entries are not accessed safely
authorLai Siyao <laisiyao@whamcloud.com>
Mon, 13 Jun 2011 03:56:03 +0000 (20:56 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 12 Dec 2011 21:41:47 +0000 (16:41 -0500)
commitad538dba7f5259df31fc45e90835edc12756db40
tree62fcd560f2f5225407234eb163d2d79d5a96a216
parent3684de257a7e8932936a27d0fdb3ecb39653e624
LU-106 procfs: many proc entries are not accessed safely

Some in memory data may be released/uninitialized at the time
of proc entry creation/removal, this patch includes the following
fixes:
* initialize data before proc entry creation
* free data after proc entry removal
* free proc entries in obd_precleanup() because
  obd_uuid/nid/nid_stats_hash are released in class_cleanup().
* free proc entries after obd_zombie_barrier() because obd_export
  hold one refcound of nid_stat.
* check osd->od_mount before accessing osd proc entries because the
  osd proc entries are created before mount.

Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: I03cb977e1be0747032a70f6a39fec804f81d70cc
Reviewed-on: http://review.whamcloud.com/326
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
15 files changed:
lustre/cmm/cmm_device.c
lustre/fld/fld_request.c
lustre/include/lprocfs_status.h
lustre/include/lustre_fld.h
lustre/lmv/lmv_obd.c
lustre/lov/lov_obd.c
lustre/mdc/mdc_request.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_lproc.c
lustre/mgs/mgs_handler.c
lustre/obdclass/lprocfs_status.c
lustre/obdclass/obd_config.c
lustre/obdfilter/filter.c
lustre/osc/osc_request.c
lustre/osd-ldiskfs/osd_lproc.c