Whamcloud - gitweb
LU-12299 libcfs: fix panic for too large cpu partions
If cpu partions larger than online cpus, following calcuation
will be 0:
num = num_online_cpus() / ncpt;
And it will trigger following panic in cfs_cpt_choose_ncpus()
LASSERT(number > 0);
We actually did not support this, instead of panic
it, return failure is better.
Also fix a invalid pointer access if we failed to init @cfs_cpt_table,
as it will be converted to ERR_PTR() if error happen.
Change-Id: I49daadd8f0c7d22aa78d08248d8c085781740768
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/34864
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Gu Zheng <gzheng@ddn.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>