Author: markj
Date: Thu Mar  8 17:04:36 2018
New Revision: 330663
URL: https://svnweb.freebsd.org/changeset/base/330663

Log:
  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.

Modified:
  head/sys/kern/kern_shutdown.c

Modified: head/sys/kern/kern_shutdown.c
==============================================================================
--- head/sys/kern/kern_shutdown.c       Thu Mar  8 16:27:31 2018        
(r330662)
+++ head/sys/kern/kern_shutdown.c       Thu Mar  8 17:04:36 2018        
(r330663)
@@ -1115,6 +1115,12 @@ dump_check_bounds(struct dumperinfo *di, off_t offset,
 
        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,
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to