• Omar Sandoval's avatar
    coredump: only charge written data against RLIMIT_CORE · 2c4cb043
    Omar Sandoval authored
    Commit 9b56d543 ("dump_skip(): dump_seek() replacement taking
    coredump_params") introduced a regression with regard to RLIMIT_CORE.
    Previously, when a core dump was sparse, only the data that was actually
    written out would count against the limit. Now, the sparse ranges are
    also included, which leads to truncated core dumps when the actual disk
    usage is still well below the limit. Restore the old behavior by only
    counting what gets emitted and ignoring what gets skipped.
    Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    2c4cb043
coredump.c 20.5 KB