Whamcloud - gitweb
LU-1299 clio: a combo patch to fix cl_lock
authorJinshan Xiong <jinshan.xiong@intel.com>
Fri, 7 Dec 2012 18:34:24 +0000 (10:34 -0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 12 Dec 2012 02:26:50 +0000 (21:26 -0500)
commitdcba8cee07ce137ecb11137ca0bb454406bff3e7
tree47afc7ca79e1139e8e34ce8512aa2966c5434be7
parentbf0ffcea349000d99b006ca8b0aef98cc2a9a010
LU-1299 clio: a combo patch to fix cl_lock

In this patch, the following issues are fixed:
* redefine cl_lock_error(). There are two kinds of error when
  enqueuing a cl_lock: internal errors return from server side and
  local error for example interrupted by signal when waiting for a
  lock. Obviously the latter one is not fatal so we shouldn't err the
  lock out;
* for fault handling, only signal SIGKILL and SIGTERM is not allowed;
* handle return code of ll_fault correctly;
* redefine ->unuse() to release resource it held if enqueuing lock
  failed;
* in cl_lock_hold_release(), only CLS_CACHED mode lock will be cached,
  for locks in other states, they will be cancelled voluntarily;
* fix the problem that cfs_block_sigs() is wrongly used as
  cfs_restore_sigs() and implementation of cfs_block_sigs() was wrong
* Unuse method releases the underneath resources even error occurs, so
  we should set the lock to be CLS_NEW anyway.
* other minor fixes.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: Iffce8be356723781b8f33ec9bdc2cf73e9e07138
Reviewed-on: http://review.whamcloud.com/2574
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
15 files changed:
libcfs/include/libcfs/libcfs.h
libcfs/libcfs/darwin/darwin-prim.c
libcfs/libcfs/linux/linux-prim.c
libcfs/libcfs/user-prim.c
lustre/include/cl_object.h
lustre/include/lustre_lib.h
lustre/include/obd_support.h
lustre/llite/llite_mmap.c
lustre/lov/lov_lock.c
lustre/lov/lovsub_lock.c
lustre/obdclass/cl_lock.c
lustre/obdclass/obd_mount.c
lustre/osc/osc_lock.c
lustre/ptlrpc/client.c
lustre/tests/sanity.sh