~ubuntu-branches/ubuntu/utopic/mariadb-5.5/utopic-security

« back to all changes in this revision

Viewing changes to storage/innobase/fil/fil0fil.c

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2014-04-17 20:55:22 UTC
  • mfrom: (2.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140417205522-wof4l36nxhlkn89m
* New upstream release, fixing the following security issues:
  * Corresponding MariaDB CVEs for Oracle SPU April 2014 (Closes: #745330)
    - CVE-2014-0384 
    - CVE-2014-2419 
    - CVE-2014-2430 
    - CVE-2014-2431 
    - CVE-2014-2432 
    - CVE-2014-2436 
    - CVE-2014-2438 
    - CVE-2014-2440
* Re-enabled TokuDB with "if arch amd64" in d/rules
* Applied patch to log init output better
  (Closes https://mariadb.atlassian.net/browse/MDEV-5957)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4110
4110
 
4111
4111
#ifdef HAVE_POSIX_FALLOCATE
4112
4112
        if (srv_use_posix_fallocate) {
4113
 
                offset_high = size_after_extend * page_size / (4ULL*1024*1024*1024);
4114
 
                offset_low = size_after_extend * page_size % (4ULL*1024*1024*1024);
 
4113
                ib_int64_t start_offset = start_page_no * page_size;
 
4114
                ib_int64_t end_offset   = (size_after_extend - start_page_no) * page_size;
 
4115
                ib_int64_t desired_size = size_after_extend*page_size;
4115
4116
 
4116
4117
                mutex_exit(&fil_system->mutex);
4117
 
                success = os_file_set_size(node->name, node->handle,
4118
 
                                offset_low, offset_high);
 
4118
 
 
4119
                if (posix_fallocate(node->handle, start_offset, end_offset) == -1) {
 
4120
                        fprintf(stderr, "InnoDB: Error: preallocating file "
 
4121
                                "space for file \'%s\' failed. Current size "
 
4122
                                " %lld, len %lld, desired size %lld\n",
 
4123
                                node->name, start_offset, end_offset, desired_size);
 
4124
                        success = FALSE;
 
4125
                } else {
 
4126
                        success = TRUE;
 
4127
                }
 
4128
 
4119
4129
                mutex_enter(&fil_system->mutex);
 
4130
 
4120
4131
                if (success) {
4121
4132
                        node->size += (size_after_extend - start_page_no);
4122
4133
                        space->size += (size_after_extend - start_page_no);
4123
4134
                        os_has_said_disk_full = FALSE;
4124
4135
                }
 
4136
 
 
4137
                fil_node_complete_io(node, fil_system, OS_FILE_READ);
4125
4138
                goto complete_io;
4126
4139
        }
4127
4140
#endif
4178
4191
 
4179
4192
        mem_free(buf2);
4180
4193
 
4181
 
#ifdef HAVE_POSIX_FALLOCATE
 
4194
        fil_node_complete_io(node, fil_system, OS_FILE_WRITE);
 
4195
 
4182
4196
complete_io:
4183
 
#endif
4184
 
 
4185
 
        fil_node_complete_io(node, fil_system, OS_FILE_WRITE);
4186
4197
 
4187
4198
        *actual_size = space->size;
4188
4199