svn commit: r225516 - head/sys/kern

[ Available lists | Index of svn-src-head | Month of Sep 2011 | Week of 12 Sep 2011 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Attilio Rao <attilio@FreeBSD.org>
Date
12 Sep 2011 20:39:32
Subject
svn commit: r225516 - head/sys/kern
Message-ID
201109122039.p8CKdV90041227@svn.freebsd.org


[ Hide this part ]
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));
}


Elapsed time: 1.836 seconds