mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-30 11:29:19 +08:00
mdbx: temporary workaround/hotfix for a flaw of Linux 4.19 (at least) unified page/buffer cache.
Temporary workaround for https://github.com/erthink/libmdbx/issues/269.
This commit is contained in:
parent
1fd4101e2e
commit
6b45498985
16
src/core.c
16
src/core.c
@ -12780,6 +12780,22 @@ __cold int mdbx_env_open(MDBX_env *env, const char *pathname,
|
||||
goto bailout;
|
||||
}
|
||||
}
|
||||
#elif defined(__linux__) || defined(__gnu_linux__)
|
||||
/* Temporary workaround for Linux 4.19 (at least) kernel's flaw.
|
||||
* See https://github.com/erthink/libmdbx/issues/269 */
|
||||
if ((flags & MDBX_WRITEMAP) == 0 &&
|
||||
mdbx_linux_kernel_version < 0x05040000) {
|
||||
if (flags & MDBX_ACCEDE)
|
||||
flags |= MDBX_WRITEMAP;
|
||||
else {
|
||||
mdbx_debug_log(MDBX_LOG_ERROR, __func__, __LINE__,
|
||||
"Linux prior to 5.4 requires MDBX_WRITEMAP because "
|
||||
"of a flaw of unified page/buffer cache. "
|
||||
"See https://github.com/erthink/libmdbx/issues/269\n");
|
||||
rc = ENOPROTOOPT;
|
||||
goto bailout;
|
||||
}
|
||||
}
|
||||
#endif /* MDBX_MMAP_INCOHERENT_FILE_WRITE */
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user