summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/amd64/dump_machdep.c12
-rw-r--r--sys/i386/i386/dump_machdep.c12
2 files changed, 14 insertions, 10 deletions
diff --git a/sys/amd64/amd64/dump_machdep.c b/sys/amd64/amd64/dump_machdep.c
index 7d1e06f..3f3acc7 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;
}
diff --git a/sys/i386/i386/dump_machdep.c b/sys/i386/i386/dump_machdep.c
index 7d1e06f..3f3acc7 100644
--- a/sys/i386/i386/dump_machdep.c
+++ b/sys/i386/i386/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;
}
OpenPOWER on IntegriCloud