Whamcloud - gitweb
LU-9664 hsm: protect cdt_state 34/27634/10
authorHongchao Zhang <hongchao.zhang@intel.com>
Sat, 2 Dec 2017 00:48:03 +0000 (08:48 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 9 Feb 2018 05:57:45 +0000 (05:57 +0000)
commit873c843ea158be8300b39582d74ff021ffae9b2f
tree113045fa3e3340c7ecfb96da801b42f63bb197d4
parent99420a1830b89a8aba6350b095065d65107f7c0f
LU-9664 hsm: protect cdt_state

In hsm_cancel_all_actions in mdt_coordinator.c, the cdt_state
could be set to wrong state if there are more than one
hsm_cancel_all_actions at the same time.

Assume the state is CDT_ENABLED before hsm_cancel_all_actions

the first call               the second call
CDT_ENABLED is saved
cdt_state = CDT_DISABLED
                             CDT_DISABLED is saved
...                          cdt_state remains CDT_DISABLED

cdt_state = CDT_ENABLED      ...
                             cdt_state = CDT_DISABLED

This patch introduces cdt_state_lock to protect the state.

Test-Parameters: trivial testlist=sanity-hsm
Change-Id: I7c976a3a506300de7cf9f5fa1d53741b2e28b654
Signed-off-by: Hongchao Zhang <hongchao.zhang@intel.com>
Reviewed-on: https://review.whamcloud.com/27634
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Quentin Bouget <quentin.bouget@cea.fr>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdt/mdt_coordinator.c
lustre/mdt/mdt_internal.h