journald: Retry if posix_fallocate returned -1 (EINTR)
On some conditions (particularly when mobile CPUs are going to sleep), the posix_fallocate(), which is called when a new journal file is allocated, can return -1 (EINTR). This is counted as a fatal error. So the journald closes both old and journals, and simply throwing away further incoming events, because of no log files open. Introduce posix_fallocate_loop() that restarts the function in the case of EINTR. Also let's make code base more uniform by returning negative values on error. Fix assert in test-sigbus.c that incorrectly counted positive values as success. After changing the function return values, that will actually work. Fixes: #19041 Signed-off-by:Igor Zhbanov <i.zhbanov@omprussia.ru> (cherry picked from commit 4c54768c)
Loading
Please register or sign in to comment