From owner-freebsd-arch@FreeBSD.ORG Sun Feb 19 00:46:23 2012 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id C6B75106566B; Sun, 19 Feb 2012 00:46:23 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-197-151.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id A8CF5150312; Sun, 19 Feb 2012 00:46:22 +0000 (UTC) Message-ID: <4F40465E.4030909@FreeBSD.org> Date: Sat, 18 Feb 2012 16:46:22 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0.2) Gecko/20120218 Thunderbird/10.0.2 MIME-Version: 1.0 To: "Andrey V. Elsukov" References: <201202171857.q1HIvZcC011615@gw.catspoiler.org> <4F3FE4D2.4090803@FreeBSD.org> In-Reply-To: <4F3FE4D2.4090803@FreeBSD.org> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------020708030107030008020108" Cc: arch@FreeBSD.org, Don Lewis Subject: Re: [patch] allow crash dumps to Linux swap partitions X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Feb 2012 00:46:23 -0000 This is a multi-part message in MIME format. --------------020708030107030008020108 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 02/18/2012 09:50, Andrey V. Elsukov wrote: > I think we can check bp->bio_from field, something like that (not tested): That made dumpon happy anyway, thanks! I'm a bit rusty on "how to cause a dump on purpose" nowadays .... I'm running 8-stable right now, if someone wants to give me a hint I'll test this. I attached a version of the patch with your updated src change, and a tweak to the comment (still not sure I'm right with that, but I didn't understand yours, sorry). Doug -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------020708030107030008020108 Content-Type: text/plain; name="kerneldump.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kerneldump.diff" Index: geom/part/g_part.c =================================================================== --- geom/part/g_part.c (revision 231902) +++ geom/part/g_part.c (working copy) @@ -2042,9 +2042,14 @@ /* * Check that the partition is suitable for kernel * dumps. Typically only swap partitions should be - * used. + * used. If the request comes from the nested scheme + * we allow dumping there as well. */ - if (!G_PART_DUMPTO(table, entry)) { + if (table->gpt_depth == 0 && + bp->bio_from != NULL && + bp->bio_from->geom->class == &g_part_class) { + /* FALLTHROUGH */ + } else if (G_PART_DUMPTO(table, entry) == 0) { g_io_deliver(bp, ENODEV); printf("GEOM_PART: Partition '%s' not suitable" " for kernel dumps (wrong type?)\n", --------------020708030107030008020108--