linux-stable/fs/ocfs2/dlm
Xue jiufei c372f2193a ocfs2/dlm: return appropriate value when dlm_grab() returns NULL
dlm_grab() may return NULL when the node is doing unmount.  When doing
code review, we found that some dlm handlers may return error to caller
when dlm_grab() returns NULL and make caller BUG or other problems.
Here is an example:

Node 1                                 Node 2
receives migration message
from node 3, and send
migrate request to others
                                     start unmounting

                                     receives migrate request
                                     from node 1 and call
                                     dlm_migrate_request_handler()

                                     unmount thread unregisters
                                     domain handlers and removes
                                     dlm_context from dlm_domains

                                     dlm_migrate_request_handlers()
                                     returns -EINVAL to node 1
Exit migration neither clearing the
migration state nor sending
assert master message to node 3 which
cause node 3 hung.

Signed-off-by: Jiufei Xue <xuejiufei@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: Yiwen Jiang <jiangyiwen@huawei.com>
Cc: 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-01-14 16:00:49 -08: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 ocfs2/dlm: cleanup unused function __dlm_wait_on_lockres_flags_set 2015-06-24 17:49:39 -07:00
dlmconvert.c
dlmconvert.h
dlmdebug.c ocfs2: fix snprintf format specifier in dlmdebug.c 2015-02-10 14:30:29 -08:00
dlmdebug.h
dlmdomain.c ocfs2: add uuid to ocfs2 thread name for problem analysis 2015-11-05 19:34:48 -08: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: return appropriate value when dlm_grab() returns NULL 2016-01-14 16:00:49 -08:00
dlmrecovery.c ocfs2/dlm: fix a race between purge and migration 2016-01-14 16:00:49 -08:00
dlmthread.c ocfs2: add uuid to ocfs2 thread name for problem analysis 2015-11-05 19:34:48 -08: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