linux-stable/fs/ocfs2/dlm
Jun Piao bb34f24c7d ocfs2/dlm: don't handle migrate lockres if already in shutdown
We should not handle migrate lockres if we are already in
'DLM_CTXT_IN_SHUTDOWN', as that will cause lockres remains after leaving
dlm domain.  At last other nodes will get stuck into infinite loop when
requsting lock from us.

The problem is caused by concurrency umount between nodes.  Before
receiveing N1's DLM_BEGIN_EXIT_DOMAIN_MSG, N2 has picked up N1 as the
migrate target.  So N2 will continue sending lockres to N1 even though
N1 has left domain.

        N1                             N2 (owner)
                                       touch file

    access the file,
    and get pr lock

                                       begin leave domain and
                                       pick up N1 as new owner

    begin leave domain and
    migrate all lockres done

                                       begin migrate lockres to N1

    end leave domain, but
    the lockres left
    unexpectedly, because
    migrate task has passed

[piaojun@huawei.com: v3]
  Link: http://lkml.kernel.org/r/5A9CBD19.5020107@huawei.com
Link: http://lkml.kernel.org/r/5A99F028.2090902@huawei.com
Signed-off-by: Jun Piao <piaojun@huawei.com>
Reviewed-by: Yiwen Jiang <jiangyiwen@huawei.com>
Reviewed-by: Joseph Qi <jiangqi903@gmail.com>
Reviewed-by: Changwei Ge <ge.changwei@h3c.com>
Cc: Mark Fasheh <mark@fasheh.com>
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>
2018-04-05 21:36:22 -07: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: remove some unused function declarations 2018-04-05 21:36:21 -07:00
dlmconvert.c ocfs2/dlm: fix race between convert and migration 2016-09-19 15:36:16 -07:00
dlmconvert.h
dlmdebug.c locking/atomic, kref: Add kref_read() 2017-01-14 11:37:18 +01:00
dlmdebug.h ocfs2/dlm: fix memory leak of dlm_debug_ctxt 2016-07-26 16:19:19 -07:00
dlmdomain.c ocfs2/dlm: don't handle migrate lockres if already in shutdown 2018-04-05 21:36:22 -07:00
dlmdomain.h ocfs2/dlm: don't handle migrate lockres if already in shutdown 2018-04-05 21:36:22 -07:00
dlmlock.c ocfs2: remove NULL assignments on static 2014-06-04 16:53:53 -07:00
dlmmaster.c fs/ocfs2/dlm/dlmmaster.c: clean up dead code 2018-01-31 17:18:34 -08:00
dlmrecovery.c ocfs2/dlm: don't handle migrate lockres if already in shutdown 2018-04-05 21:36:22 -07:00
dlmthread.c ocfs2/dlm: continue to purge recovery lockres when recovery master goes down 2016-08-02 17:31:41 -04:00
dlmunlock.c locking/atomic, kref: Add kref_read() 2017-01-14 11:37:18 +01:00
Makefile ocfs2: remove versioning information 2014-01-21 16:19:41 -08:00