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>
Fri, 16 Mar 2012 01:50:15 +0000 (21:50 -0400)
commite6a26d5b568ee8c6b37d58aef460d2f1dac1d5a4
tree97da803556a6a6cce598f2cbd0e351a940488faa
parent2e8ea9391ffe458f16e23df08f2f18f1e38e1beb
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