Whamcloud - gitweb
LU-9065 osc: fix for cl_env_get in low memory 71/25171/7
authorAlexander Boyko <alexander.boyko@seagate.com>
Tue, 31 Jan 2017 11:26:24 +0000 (14:26 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Apr 2017 04:43:41 +0000 (04:43 +0000)
commitfd1aafaf99b81c070a46e1481734932a0e53ef28
tree461d30557562fe09815ca92054abf3af2178b463
parent5ed38cca120f4ead549ebad0a221b74c5f2bdc31
LU-9065 osc: fix for cl_env_get in low memory

In low memory situation cl_env_get->cl_env_new->kmem_cache_alloc
could fail with ENOMEM error. Some parts doesn`t handle error
case, for example:
...(osc_lock_upcall()) ASSERTION( !IS_ERR(env) ) failed:
...(osc_lock.c:315:osc_lock_upcall()) LBUG

For osc_lock_upcall() the patch changes cl_env_get to
cl_env_percpu_peek, this prevents memory allocation and
couldn`t fail in low memory case.
For osc_extent_truncate() the patch adds error handle.

Signed-off-by: Alexander Boyko <alexander.boyko@seagate.com>
Change-Id: I4fbca9f3bdc77a5c52979eeb0e00e915ff9ad9b0
Seagate-bug-id: MRP-4120
Reviewed-on: https://review.whamcloud.com/25171
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@seagate.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osc/osc_cache.c
lustre/osc/osc_lock.c