Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Feb 2012 16:46:22 -0800
From:      Doug Barton <dougb@FreeBSD.org>
To:        "Andrey V. Elsukov" <ae@FreeBSD.org>
Cc:        arch@FreeBSD.org, Don Lewis <truckman@FreeBSD.org>
Subject:   Re: [patch] allow crash dumps to Linux swap partitions
Message-ID:  <4F40465E.4030909@FreeBSD.org>
In-Reply-To: <4F3FE4D2.4090803@FreeBSD.org>
References:  <201202171857.q1HIvZcC011615@gw.catspoiler.org> <4F3FE4D2.4090803@FreeBSD.org>

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



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