Commit 54227847 authored by Vlad Lesin's avatar Vlad Lesin

MDEV-31256 fil_node_open_file() releases fil_system.mutex allowing other...

MDEV-31256 fil_node_open_file() releases fil_system.mutex allowing other thread to open its file node

There is room between mutex_exit(&fil_system.mutex) and
mutex_enter(&fil_system.mutex) calls in fil_node_open_file(). During this
room another thread can open the node, and ut_ad(!node->is_open())
assertion in fil_node_open_file_low() can fail.

The fix is not to open node if it was already opened by another thread.
parent 06d555a4
......@@ -458,7 +458,9 @@ static bool fil_node_open_file(fil_node_t *node)
}
}
return fil_node_open_file_low(node);
/* The node can be opened beween releasing and acquiring fil_system.mutex
in the above code */
return node->is_open() || fil_node_open_file_low(node);
}
/** Close the file handle. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment