summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2011-09-12 20:39:31 +0000
committerattilio <attilio@FreeBSD.org>2011-09-12 20:39:31 +0000
commit2267bc943085ba9e7c004de622fc5d706e7fb164 (patch)
tree9848769dbe3a3de6b80f483cc3c1ef716720628c /sys/kern
parentc73be1deff65dd32d240d5011cdb8ce0795b446c (diff)
downloadFreeBSD-src-2267bc943085ba9e7c004de622fc5d706e7fb164.zip
FreeBSD-src-2267bc943085ba9e7c004de622fc5d706e7fb164.tar.gz
dump_write() returns ENXIO if the dump is trying to be written outside
of the device boundry. While this is generally ok, the problem is that all the consumers handle similar cases (and expect to catch) ENOSPC for this (for a reference look at minidumpsys() and dumpsys() constructions). That ends up in consumers not recognizing the issue and amd64 failing to retry if the number of pages grows up during minidump. Fix this by returning ENOSPC in dump_write() and while here add some more diagnostic on involved values. Sponsored by: Sandvine Incorporated In collabouration with: emaste Approved by: re (kib) MFC after: 10 days
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_shutdown.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index 6a8a597..c1e3dda 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -705,8 +705,11 @@ dump_write(struct dumperinfo *di, void *virtual, vm_offset_t physical,
if (length != 0 && (offset < di->mediaoffset ||
offset - di->mediaoffset + length > di->mediasize)) {
- printf("Attempt to write outside dump device boundaries.\n");
- return (ENXIO);
+ 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,
+ (uintmax_t)length, (intmax_t)di->mediasize);
+ return (ENOSPC);
}
return (di->dumper(di->priv, virtual, physical, offset, length));
}
OpenPOWER on IntegriCloud