Whamcloud - gitweb
LU-5422 obdclass: Fix null pointer derefs in lu_cache_shrink() 44/11244/3
authorLi Wei <wei.g.li@intel.com>
Mon, 28 Jul 2014 03:57:14 +0000 (11:57 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 11 Aug 2014 04:21:49 +0000 (04:21 +0000)
commitd6ab7f7304cc8e0dbc971a098a6f4d0a8ad96dcf
tree3598ded1d8ab846d24e9d8a0a858527f4dc85c64
parentf1a411bc79f8acc61bc1a18e42558513e44a2da6
LU-5422 obdclass: Fix null pointer derefs in lu_cache_shrink()

When lu_cache_shrink() is called on a machine with no Lustre targets
mounted, the following null pointer dereference may happen:

  BUG: unable to handle kernel NULL pointer dereference at (null)
  IP: [<ffffffffa0aed076>] lu_cache_shrink+0x156/0x310 [obdclass]

This is a regression introduced recently by 8701e7e.  lu_sites must be
initialized before the lu_sites shrinker is registered.  And, it
cannot be re-initialized every time when an lu_site is initialized.

Change-Id: Ieebd2ff1bcde4096037658a22956355283122182
Signed-off-by: Li Wei <wei.g.li@intel.com>
Reviewed-on: http://review.whamcloud.com/11244
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdclass/lu_object.c