aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>2002-12-16 23:25:12 +0000
committerJulian Elischer <julian@FreeBSD.org>2002-12-16 23:25:12 +0000
commit4706b50a40ffddd1fe1ea1fc719fc99474070f91 (patch)
tree9386166eb0dab117776800ec70d74c7fb96abd99 /sys/amd64
parenta1d5f791fa318035b0f4438b9749a9271792ad30 (diff)
Notes
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/dump_machdep.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/amd64/amd64/dump_machdep.c b/sys/amd64/amd64/dump_machdep.c
index 7d1e06f969eb7..3f3acc729d768 100644
--- a/sys/amd64/amd64/dump_machdep.c
+++ b/sys/amd64/amd64/dump_machdep.c
@@ -75,12 +75,14 @@ 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) + /* Memory to save */
- (sizeof kdh * 2) + /* header + trailer */
- (64*1024))) { /* Room to leave untouched */
- /* at partition head. */
- /* (an arbitrary amount). */
+ Maxmem * (off_t)PAGE_SIZE + sizeof kdh * 2 + 64*1024) {
printf("\nDump failed. Partition too small.\n");
return;
}