svn commit: r225516 - head/sys/kern
Attilio Rao
attilio at FreeBSD.org
Mon Sep 12 20:39:32 UTC 2011
Author: attilio
Date: Mon Sep 12 20:39:31 2011
New Revision: 225516
URL: http://svn.freebsd.org/changeset/base/225516
Log:
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
Modified:
head/sys/kern/kern_shutdown.c
Modified: head/sys/kern/kern_shutdown.c
==============================================================================
--- head/sys/kern/kern_shutdown.c Mon Sep 12 15:21:52 2011 (r225515)
+++ head/sys/kern/kern_shutdown.c Mon Sep 12 20:39:31 2011 (r225516)
@@ -705,8 +705,11 @@ dump_write(struct dumperinfo *di, void *
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));
}
More information about the svn-src-all
mailing list