Whamcloud - gitweb
LU-12477 lustre: check return status of register_shrinker() 83/40883/4
authorMr NeilBrown <neilb@suse.de>
Mon, 7 Dec 2020 02:07:31 +0000 (13:07 +1100)
committerOleg Drokin <green@whamcloud.com>
Wed, 10 Mar 2021 08:03:01 +0000 (08:03 +0000)
commit812b2ccf0284df42e8a88a6b7c4c3874dd721c71
tree232a848ad56af88f6d46c8f8b8f18f0dc845430d
parent782725b11021b2f1c3467863216836ee94bcd874
LU-12477 lustre: check return status of register_shrinker()

register_shrinker() can fail with -ENOMEM.  We should check for that
and abort the relevant initialization functions when it happens.

For ldlm_pools, ldlm_pools_fini() can be called when ldlm_pools_init()
fails, or even in case where it hasn't been called.  So add a static
flag to ensure we ldlm_pools_fini() does undo things that haven't been
done.

For lu_global_init() we need to add proper cleanup if anything fails.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ie66326486c7738547d4211095bb1d37dc75e0b6a
Reviewed-on: https://review.whamcloud.com/40883
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/include/lustre_compat.h
lustre/ldlm/ldlm_pool.c
lustre/obdclass/lu_object.c
lustre/osc/osc_request.c
lustre/ptlrpc/sec_bulk.c