Skip to content

Commit

Permalink
fallback to manually consume space if posix_fallocate isn't supported…
Browse files Browse the repository at this point in the history
… at runtime
  • Loading branch information
ironage committed Jan 11, 2024
1 parent da5cefa commit 4db9e0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### Fixed
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
* None.
* Handle `EOPNOTSUPP` when using `posix_fallocate()` and fallback to manually consume space. This should enable android users to open a Realm on restrictive filesystems. ([realm-js #6349](https://github.com/realm/realm-js/issues/6349), more prevalent since v13.23.3 with the change to `REALM_HAVE_POSIX_FALLOCATE` but it was also an issue in some platforms before this)

### Breaking changes
* `App::get_uncached_app(...)` and `App::get_shared_app(...)` have been replaced by `App::get_app(App::CacheMode, ...)`. The App constructor is now enforced to be unusable, use `App::get_app()` instead. ([#7237](https://github.com/realm/realm-core/issues/7237))
Expand Down
2 changes: 1 addition & 1 deletion src/realm/util/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ bool File::prealloc_if_supported(SizeType offset, size_t size)
return true;
}

if (status == EINVAL || status == EPERM) {
if (status == EINVAL || status == EPERM || status == EOPNOTSUPP) {
return false; // Retry with non-atomic version
}

Expand Down

0 comments on commit 4db9e0b

Please sign in to comment.