Whamcloud - gitweb
LU-10932 libcfs: properly handle failure cases in SMP code 85/32085/2
authorJames Simmons <uja.ornl@yahoo.com>
Thu, 19 Apr 2018 17:06:53 +0000 (13:06 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 6 May 2018 03:40:57 +0000 (03:40 +0000)
commit9776609833dff17f20c31fe727492204620b54af
treeab26b057ce1b08c1d2a688943146ca9212ffc73f
parentb99344dda425b78e006c49b1d2b22c75585ca306
LU-10932 libcfs: properly handle failure cases in SMP code

While pushing the LU-8703 and LU-7734 work upstream some bugs were
pointed out by Dan Carpenter in the code. Due to single err label
in cfs_cpt_table_alloc() and cfs_cpu_init() a few items were being
cleaned up that were never initialized. This can lead to crashed
and other problems. In those initialization function introduce
individual labels to jump to only the thing initialized get freed
on failure. Lastly in cfs_cpt_table_alloc() handle the failure
case instead of the passed case which is the perferred style.

Change-Id: I969f4e327888042a517bc321b68d55fc691b074e
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/32085
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/libcfs/libcfs_cpu.c
libcfs/libcfs/linux/linux-cpu.c