chiark / gitweb /
journald: process SIGBUS for the memory maps we set up
authorLennart Poettering <lennart@poettering.net>
Tue, 30 Dec 2014 19:57:53 +0000 (20:57 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 5 Jan 2015 00:40:51 +0000 (01:40 +0100)
commitfa6ac76083b8ffc1309876459f54f9f0e2843731
tree5169233d54825b07e63da5d11fbc3b4e248aa38b
parentf93bf4363395018ef48d744c4624158623afd693
journald: process SIGBUS for the memory maps we set up

Even though we use fallocate() it appears that file systems like btrfs
will trigger SIGBUS on certain low-disk-space situation. We should
handle that, hence catch the signal, add it to a list of invalidated
pages, and replace the page with an empty memory area. After each write
check if SIGBUS was triggered, and consider the write invalid if it was.

This should make journald a lot more robust with file systems where
fallocate() is not reliable, for example all CoW file systems
(btrfs...), where changing written data can fail with disk full errors.

https://bugzilla.redhat.com/show_bug.cgi?id=1045810
.gitignore
Makefile.am
src/journal/journal-file.c
src/journal/journal-file.h
src/journal/journald-server.c
src/journal/journald.c
src/journal/mmap-cache.c
src/journal/mmap-cache.h
src/shared/sigbus.c [new file with mode: 0644]
src/shared/sigbus.h [new file with mode: 0644]
src/test/test-sigbus.c [new file with mode: 0644]