Skip to content
Commit 75533624 authored by Igor Zhbanov's avatar Igor Zhbanov Committed by Zbigniew Jędrzejewski-Szmek
Browse files

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: default avatarIgor Zhbanov <i.zhbanov@omprussia.ru>
(cherry picked from commit 4c54768c)
parent 80a7922d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment