Skip to content

Commit 3aea77e

Browse files
committed
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 e3b0615 from 10.6.
1 parent 383105d commit 3aea77e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

storage/innobase/fil/fil0fil.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ fil_node_t* fil_space_t::add(const char* name, pfs_os_file_t handle,
350350
this->size += size;
351351
UT_LIST_ADD_LAST(chain, node);
352352
if (node->is_open()) {
353+
node->find_metadata(node->handle);
353354
n_pending.fetch_and(~CLOSING, std::memory_order_relaxed);
354355
if (++fil_system.n_open >= srv_max_n_open_files) {
355356
reacquire();
@@ -2433,7 +2434,6 @@ fil_ibd_create(
24332434
mtr.log_file_op(FILE_CREATE, space_id, node->name);
24342435
mtr.commit();
24352436

2436-
node->find_metadata(file);
24372437
*err = DB_SUCCESS;
24382438
return space;
24392439
}

0 commit comments

Comments
 (0)