From owner-svn-src-head@FreeBSD.ORG Mon Sep 12 20:39:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B89EA106564A; Mon, 12 Sep 2011 20:39:32 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFBF48FC13; Mon, 12 Sep 2011 20:39:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8CKdV8P041229; Mon, 12 Sep 2011 20:39:31 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8CKdV90041227; Mon, 12 Sep 2011 20:39:31 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201109122039.p8CKdV90041227@svn.freebsd.org> From: Attilio Rao Date: Mon, 12 Sep 2011 20:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225516 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2011 20:39:32 -0000 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)); }