Skip to contentSkip to conversation

tmpfs:losing data when preallocating space multiple times with fallocate

BUG 陈国祺 1 participant 1 message Oct 31, 2022 Memory management

lore
Share & tools
lore

陈国祺

author
#0 lore raw

Hi, all

When using the system call fallocate to pre-allocate more space on the tmpfs file system, if the kernel returns an error EINTR, the original data on the file will be lost (it seems to be the beginning of the file every time, the size is one page).

- Test case: https://github.com/abner-chenc/abner/blob/master/fallocate.c
- Kernel commit: b229b6ca5abbd63ff40c1396095b1b36b18139c3
- Arch: x86, loongarch64