summaryrefslogtreecommitdiff
path: root/storage/innobase/os
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-09-11 11:21:39 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-09-11 11:21:39 +0300
commit101d10b88362b5087197c10ff09b96bf1d570ebd (patch)
tree31e81255755cd4345e57e882532d211bd5bafd1a /storage/innobase/os
parent098106b4327d549bca226ccdeec107dbc3237e97 (diff)
parentbcd25e1066bcf545d8f6988ef9f1c0983db2bcfd (diff)
downloadmariadb-git-101d10b88362b5087197c10ff09b96bf1d570ebd.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'storage/innobase/os')
-rw-r--r--storage/innobase/os/os0file.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index f08aa7e025f..25d7ac49bc4 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -4989,6 +4989,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.
@@ -5030,7 +5032,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);
}
@@ -5070,8 +5072,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;