• J
    ocfs2: fix race between mount and delete node/cluster · 0986fe9b
    Joseph Qi 提交于
    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: NJoseph Qi <joseph.qi@huawei.com>
    Cc: Mark Fasheh <mfasheh@suse.com>
    Cc: Joel Becker <jlbec@evilplan.org>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    0986fe9b
heartbeat.c 68.7 KB