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 (#7251)
  • Loading branch information
ironage authored Jan 12, 2024
1 parent a558fa4 commit 865cf5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* None.

### Fixed
* 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)
* Application may crash with `incoming_changesets.size() != 0` when a download message is mistaken for a bootstrap message (PR [#7238](https://github.com/realm/realm-core/pull/7238), since v11.8.0)

### Breaking changes
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 865cf5e

Please sign in to comment.