Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Sep 2011 20:39:31 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r225516 - head/sys/kern
Message-ID:  <201109122039.p8CKdV90041227@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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));
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109122039.p8CKdV90041227>