ocfs2/dlm: fix a race between refmap setting and clearing
Hi,
This serial of patches is to fix the dis-order issue of setting/clearing refmap bit described below.
Node 1 Node 2(master)
dlmlockdlm_do_master_request
dlm_master_request_handler
-> dlm_lockres_set_refmap_bitdlmlock succeed
dlmunlock succeed
dlm_purge_lockres
dlm_deref_handler
-> find lock resource is in
DLM_LOCK_RES_SETREF_INPROG state, so dispatch a deref workdlm_purge_lockres succeed.
call dlmlock againdlm_do_master_request
dlm_master_request_handler -> dlm_lockres_set_refmap_bit
deref work trigger, call dlm_lockres_clear_refmap_bit to clear Node 1 from refmap
dlm_purge_lockres succeed
dlm_send_remote_lock_request
return DLM_IVLOCKID because the lockres is not exist
BUG if the lockres is $RECOVERY
This serial of patches add a new message to keep the order of set and clear. Other nodes can purge the lock resource only after the refmap bit on master is cleared.
Jiufei Xue (4):
ocfs2/dlm: add DEREF_DONE message
ocfs2/dlm: return in progress if master can not clear the refmap
bit right now
ocfs2/dlm: clear DROPPING_REF flag when the master down ocfs2/dlm: return EINVAL when the lockres on migration target is
in DROPPING_REF state
dlmcommon.h | 17 +++++++ dlmdomain.c | 11 ++++- dlmmaster.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- dlmrecovery.c | 32 ++++++++++---- dlmthread.c | 7 +++ 5 files changed, 178 insertions(+), 13 deletions(-)
Thanks,
Jiufei Xue
Hi Jiufei,
Thanks very much for your effort.
Thanks,
Joseph
Quoted 60 lines · xuejiufei
Hi,
This serial of patches is to fix the dis-order issue of setting/clearing refmap bit described below.Node 1 Node 2(master)
dlmlockdlm_do_master_requestdlm_master_request_handler -> dlm_lockres_set_refmap_bitdlmlock succeed
dlmunlock succeed
dlm_purge_lockres
dlm_deref_handler
-> find lock resource is in
DLM_LOCK_RES_SETREF_INPROGstate, so dispatch a deref workdlm_purge_lockressucceed.call dlmlock again
dlm_do_master_request
dlm_master_request_handler->dlm_lockres_set_refmap_bitderef work trigger, call
dlm_lockres_clear_refmap_bitto clear Node 1 from refmap
dlm_purge_lockressucceed
dlm_send_remote_lock_request
returnDLM_IVLOCKIDbecause the lockres is not exist
BUG if the lockres is $RECOVERYThis serial of patches add a new message to keep the order of set and clear. Other nodes can purge the lock resource only after the refmap bit on master is cleared.
Jiufei Xue (4):
ocfs2/dlm: addDEREF_DONEmessage
ocfs2/dlm: return in progress if master can not clear the refmap
bit right now
ocfs2/dlm: clearDROPPING_REFflag when the master down ocfs2/dlm: return EINVAL when the lockres on migration target is
inDROPPING_REFstatedlmcommon.h | 17 +++++++ dlmdomain.c | 11 ++++- dlmmaster.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- dlmrecovery.c | 32 ++++++++++---- dlmthread.c | 7 +++ 5 files changed, 178 insertions(+), 13 deletions(-)Thanks,
Jiufei Xue.