]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ocfs2: fix race between mount and delete node/cluster
authorJoseph Qi <joseph.qi@huawei.com>
Fri, 6 Nov 2015 02:44:07 +0000 (18:44 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 26 Nov 2016 23:43:20 +0000 (15:43 -0800)
commit0ac0d1194ac649a44e771c8cf3366aec7a43eeb4
treed147837414715723d7724e151ee3c3939550f032
parentc267ae6e374a79401258c5ed5e94019cd832c89b
ocfs2: fix race between mount and delete node/cluster

There is a race case between mount and delete node/cluster, which will
lead o2hb_thread to malfunctioning dead loop.

    o2hb_thread
    {
        o2nm_depend_this_node();
        <<<<<< race window, node may have already been deleted, and then
               enter the loop, o2hb thread will be malfunctioning
               because of no configured nodes found.
        while (!kthread_should_stop() &&
               !reg->hr_unclean_stop && !reg->hr_aborted_start) {
    }

So check the return value of o2nm_depend_this_node() is needed.  If node
has been deleted, do not enter the loop and let mount fail.

Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 0986fe9b50f425ec81f25a1a85aaf3574b31d801)

Orabug: 24939243

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
fs/ocfs2/cluster/heartbeat.c