linux-stable/fs/ocfs2/dlm
piaojun 86b652b93a ocfs2/dlm: disable BUG_ON when DLM_LOCK_RES_DROPPING_REF is cleared before dlm_deref_lockres_done_handler
We found a BUG situation in which DLM_LOCK_RES_DROPPING_REF is cleared
unexpected that described below.  To solve the bug, we disable the
BUG_ON and purge lockres in dlm_do_local_recovery_cleanup.

Node 1                               Node 2(master)
dlm_purge_lockres
                                     dlm_deref_lockres_handler

                                     DLM_LOCK_RES_SETREF_INPROG is set
                                     response DLM_DEREF_RESPONSE_INPROG

receive DLM_DEREF_RESPONSE_INPROG
stop puring in dlm_purge_lockres
and wait for DLM_DEREF_RESPONSE_DONE

                                     dispatch dlm_deref_lockres_worker
                                     response DLM_DEREF_RESPONSE_DONE

receive DLM_DEREF_RESPONSE_DONE and
prepare to purge lockres

                                     Node 2 goes down

find Node2 down and do local
clean up for Node2:
dlm_do_local_recovery_cleanup
  -> clear DLM_LOCK_RES_DROPPING_REF

when purging lockres, BUG_ON happens
because DLM_LOCK_RES_DROPPING_REF is clear:
dlm_deref_lockres_done_handler
  ->BUG_ON(!(res->state & DLM_LOCK_RES_DROPPING_REF));

[akpm@linux-foundation.org: fix duplicated write to `ret']
Fixes: 60d663cb52 ("ocfs2/dlm: add DEREF_DONE message")
Link: http://lkml.kernel.org/r/57845055.9080702@huawei.com
Signed-off-by: Jun Piao <piaojun@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: Jiufei Xue <xuejiufei@huawei.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-08-02 17:31:41 -04:00
..
dlmapi.h
dlmast.c o2dlm: fix NULL pointer dereference in o2dlm_blocking_ast_wrapper 2015-02-10 14:30:30 -08:00
dlmcommon.h vfs: make the string hashes salt the hash 2016-06-10 20:21:46 -07:00
dlmconvert.c ocfs2/dlm: move lock to the tail of grant queue while doing in-place convert 2016-03-25 16:37:42 -07:00
dlmconvert.h
dlmdebug.c ocfs2/dlm: fix memory leak of dlm_debug_ctxt 2016-07-26 16:19:19 -07:00
dlmdebug.h ocfs2/dlm: fix memory leak of dlm_debug_ctxt 2016-07-26 16:19:19 -07:00
dlmdomain.c ocfs2/dlm: fix a variable overflow problem in dlmdomain.c 2016-03-15 16:55:16 -07:00
dlmdomain.h ocfs2: dlm: dlmdomain: remove unused function 2015-02-10 14:30:29 -08:00
dlmlock.c ocfs2: remove NULL assignments on static 2014-06-04 16:53:53 -07:00
dlmmaster.c ocfs2/dlm: disable BUG_ON when DLM_LOCK_RES_DROPPING_REF is cleared before dlm_deref_lockres_done_handler 2016-08-02 17:31:41 -04:00
dlmrecovery.c ocfs2/dlm: fix BUG in dlm_move_lockres_to_recovery_list 2016-03-25 16:37:42 -07:00
dlmthread.c ocfs2: fix a tiny race that leads file system read-only 2016-03-15 16:55:16 -07:00
dlmunlock.c ocfs2/dlm: return appropriate value when dlm_grab() returns NULL 2016-01-14 16:00:49 -08:00
Makefile ocfs2: remove versioning information 2014-01-21 16:19:41 -08:00