diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-09-11 11:14:18 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-09-11 11:14:18 +0300 |
commit | bcd25e1066bcf545d8f6988ef9f1c0983db2bcfd (patch) | |
tree | cd9578d16e088bd57e169d1430a20a5704557545 /storage/innobase/os | |
parent | 46cb16388a865d9561ba234011085ad2a8e42c44 (diff) | |
parent | ac064c2b4721fe3d7cafae3b4dfa5853f0797347 (diff) | |
download | mariadb-git-bcd25e1066bcf545d8f6988ef9f1c0983db2bcfd.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'storage/innobase/os')
-rw-r--r-- | storage/innobase/os/os0file.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 4ec42eb805a..b099f25cd35 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -5351,6 +5351,8 @@ os_file_set_size( os_offset_t size, bool is_sparse) { + ut_ad(!(size & 4095)); + #ifdef _WIN32 /* On Windows, changing file size works well and as expected for both sparse and normal files. @@ -5392,7 +5394,7 @@ fallback: if (current_size >= size) { return true; } - current_size &= ~os_offset_t(statbuf.st_blksize - 1); + current_size &= ~4095ULL; err = posix_fallocate(file, current_size, size - current_size); } @@ -5432,8 +5434,7 @@ fallback: if (fstat(file, &statbuf)) { return false; } - os_offset_t current_size = statbuf.st_size - & ~os_offset_t(statbuf.st_blksize - 1); + os_offset_t current_size = statbuf.st_size & ~4095ULL; #endif if (current_size >= size) { return true; |