mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
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.
This commit is contained in:
parent
06d555a41a
commit
5422784792
1 changed files with 3 additions and 1 deletions
|
@ -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. */
|
||||
|
|
Loading…
Reference in a new issue