From 109858b994eb708607c1a0dd7f286f3973084083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Sun, 24 Aug 2025 09:03:54 +0300 Subject: [PATCH] mdbx-test: workaround for the `ENOSPC` from a `tmpfs`. --- src/osal.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osal.c b/src/osal.c index 0c44e3f8..726a533d 100644 --- a/src/osal.c +++ b/src/osal.c @@ -1628,6 +1628,12 @@ int osal_fallocate(mdbx_filehandle_t fd, uint64_t length) { if (fcntl(fd, F_PREALLOCATE, &store)) err = ignore_enosys_and_eremote(errno); #endif /* Apple */ +#if !defined(_WIN32) && !defined(_WIN64) + /* Workaround for testing: ignore ENOSPC for TMPFS/RAMFS. + * This is insignificant for production, but it helps in some tests using /dev/shm inside docker/containers. */ + if (err == ENOSPC && osal_check_fs_incore(fd) == MDBX_RESULT_TRUE) + err = MDBX_RESULT_TRUE; +#endif /* !Windows */ return (err == MDBX_RESULT_TRUE) ? osal_ftruncate(fd, length) : err; }