LP #1287098: Double fil_system->mutex exit in fil_extend_space_to_desired_size if posix_fallocate is used

Description

**Reported in Launchpad by Raghavendra D Prabhu last update 04-03-2014 13:05:21

Here:

/* At this point it is safe to release fil_system mutex. No
other thread can rename, delete or close the file because
we have set the node->being_extended flag. */
mutex_exit(&fil_system->mutex);

start_page_no = space->size;
file_start_page_no = space->size - node->size;

#ifdef HAVE_POSIX_FALLOCATE
if (srv_use_posix_fallocate) {

mutex_exit(&fil_system->mutex);
success = os_file_set_size(node->name, node->handle,
(size_after_extend

  • file_start_page_no) * page_size);
    mutex_enter(&fil_system->mutex);
    if (success) {
    node->size += (size_after_extend - start_page_no);
    space->size += (size_after_extend - start_page_no);
    os_has_said_disk_full = FALSE;
    }
    node->being_extended = FALSE;
    fil_node_complete_io(node, fil_system, OS_FILE_READ);
    goto complete_io;
    }
    #endif

the mutex_exit and mutex_enter are reversed. (may be a merge regression etc.)

Environment

None

Activity

Done

Details

Assignee

Reporter

Priority

Created January 20, 2018 at 7:41 PM
Updated January 20, 2018 at 7:41 PM
Resolved January 20, 2018 at 7:41 PM