URL:
https://github.com/SSSD/sssd/pull/5370
Title: #5370: nss: Use posix_fallocate() to alloc memcache file
alexey-tikhonov commented:
"""
A couple of remarks:
- `ftruncate`
[
promises](https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftru...
"If the file size is increased, the extended area shall appear as if it were
zero-filled." While it's natural to expect the same from `posix_fallocate`, I
can't find explicit confirmation in the docs...
- [glibc
docs](https://www.gnu.org/software/libc/manual/html_node/Storage-Allocati... say:
"such pre-allocation may not reliably prevent the out-of-disk-space error from
occurring later. Checking for write errors is still required, and writes to memory-mapped
regions created with mmap can still result in SIGBUS." But perhaps this is still
better than `ftruncate`...
"""
See the full comment at
https://github.com/SSSD/sssd/pull/5370#issuecomment-708564631