Return E2BIG if we run out of space writing a compressed kernel dump.

ENOSPC causes the MD kernel dump code to retry the dump, but this is
undesirable in the case where we legitimately ran out of space.
This commit is contained in:
Mark Johnston 2018-03-08 17:04:36 +00:00
parent 50e3ba10e8
commit bde3b1e1a5

View File

@ -1115,6 +1115,12 @@ dump_check_bounds(struct dumperinfo *di, off_t offset, size_t length)
if (length != 0 && (offset < di->mediaoffset ||
offset - di->mediaoffset + length > di->mediasize)) {
if (di->kdcomp != NULL && offset >= di->mediaoffset) {
printf(
"Compressed dump failed to fit in device boundaries.\n");
return (E2BIG);
}
printf("Attempt to write outside dump device boundaries.\n"
"offset(%jd), mediaoffset(%jd), length(%ju), mediasize(%jd).\n",
(intmax_t)offset, (intmax_t)di->mediaoffset,