MDEV-35608 Fake PMEM on /dev/shm no longer works

In commit 6acada713a the
logic for treating the file system of /dev/shm
as if it were persistent memory was broken.

Let us restore the original logic, so that we will have
some more CI coverage of the memory-mapped redo log interface.
This commit is contained in:
Marko Mäkelä 2024-12-09 12:53:38 +02:00
parent 9428647be3
commit 1a557d087c

View file

@ -255,6 +255,10 @@ static void *log_mmap(os_file_t file,
if (!read_only)
# ifdef HAVE_PMEM
prot= PROT_READ | PROT_WRITE;
# ifdef __linux__ /* On Linux, we pretend that /dev/shm is PMEM */
remap:
# endif
# else
return MAP_FAILED;
# endif
@ -270,8 +274,9 @@ static void *log_mmap(os_file_t file,
# ifdef HAVE_PMEM
# ifdef __linux__ /* On Linux, we pretend that /dev/shm is PMEM */
if (srv_operation < SRV_OPERATION_BACKUP)
if (flags != MAP_SHARED && srv_operation < SRV_OPERATION_BACKUP)
{
flags= MAP_SHARED;
struct stat st;
if (!fstat(file, &st))
{
@ -283,6 +288,7 @@ static void *log_mmap(os_file_t file,
is_pmem= st.st_dev == st_dev;
if (!is_pmem)
return ptr; /* MAP_FAILED */
goto remap;
}
}
}