mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
MDEV-31347 fil_ibd_create() may hijack the file handle of an old file
fil_space_t::add(): If a file handle was passed, invoke
fil_node_t::find_metadata() before releasing fil_system.mutex.
The call was moved from fil_ibd_create().
This is a 10.5 version of commit e3b06156c6
from 10.6.
This commit is contained in:
@@ -350,6 +350,7 @@ fil_node_t* fil_space_t::add(const char* name, pfs_os_file_t handle,
|
||||
this->size += size;
|
||||
UT_LIST_ADD_LAST(chain, node);
|
||||
if (node->is_open()) {
|
||||
node->find_metadata(node->handle);
|
||||
n_pending.fetch_and(~CLOSING, std::memory_order_relaxed);
|
||||
if (++fil_system.n_open >= srv_max_n_open_files) {
|
||||
reacquire();
|
||||
@@ -2433,7 +2434,6 @@ err_exit:
|
||||
mtr.log_file_op(FILE_CREATE, space_id, node->name);
|
||||
mtr.commit();
|
||||
|
||||
node->find_metadata(file);
|
||||
*err = DB_SUCCESS;
|
||||
return space;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user