Whamcloud - gitweb
LU-4684 llite: add lock for dir layout data 46/32946/15
authorLai Siyao <lai.siyao@intel.com>
Fri, 20 Jul 2018 04:26:41 +0000 (12:26 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 2 Nov 2018 07:19:06 +0000 (07:19 +0000)
commitae828cd3b092a38adbc86a4da320dd9d3a0fc80c
tree4b29766adf7fc461c740931b0506aac389797eef
parent86bb350708ed035309466286152707f3a1d3a1a1
LU-4684 llite: add lock for dir layout data

Directory layout data should be accessed with lock, because
directory migration may change it, if it's accessed without lock,
it may cause crash.

Introduce an rw_semaphore 'lli_lsm_sem', any MD operation that uses
directory layout data will take read lock, and ll_update_lsm_md()
will take write lock when setting lsm.

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: Ice3b15c90eefd6c9dbefbea87cd65f436bec96b1
Reviewed-on: https://review.whamcloud.com/32946
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_lmv.h
lustre/include/obd.h
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/namei.c
lustre/llite/statahead.c
lustre/lmv/lmv_obd.c