summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Walter <ticso@FreeBSD.org>2003-01-03 00:19:54 +0000
committerBernd Walter <ticso@FreeBSD.org>2003-01-03 00:19:54 +0000
commitfcab1602ae51047e774911f8e332ee6129a57746 (patch)
tree7cf70fadfb318f022ef7b8b8e91b4cd63eb51bce
parent1f88bad30a43fd87db7a10075629a7e5c6beb609 (diff)
Notes
-rw-r--r--sys/alpha/alpha/dump_machdep.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/alpha/alpha/dump_machdep.c b/sys/alpha/alpha/dump_machdep.c
index 902cf129a746..63f98e2ca580 100644
--- a/sys/alpha/alpha/dump_machdep.c
+++ b/sys/alpha/alpha/dump_machdep.c
@@ -73,6 +73,18 @@ dumpsys(struct dumperinfo *di)
strncpy(kdh.panicstring, panicstr, sizeof kdh.panicstring);
kdh.parity = kerneldump_parity(&kdh);
+ /*
+ * Check if we will have enough room to save the coredump.
+ * The partition size needed is the sum of:
+ * Memory to save + header + trailer + Room to leave untouched
+ * at partition head. (an arbitrary amount).
+ */
+ if (di->mediasize <
+ Maxmem * (off_t)PAGE_SIZE + sizeof kdh * 2 + 64*1024) {
+ printf("\nDump failed. Partition too small.\n");
+ return;
+ }
+
dumplo = di->mediaoffset + di->mediasize - Maxmem * (off_t)PAGE_SIZE;
dumplo -= sizeof kdh * 2;
i = di->dumper(di->priv, &kdh, NULL, dumplo, sizeof kdh);