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

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------060705090304070700000607
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: 8bit

On 17.02.2012 22:57, Don Lewis wrote:
>> MBR scheme also allows dumping only to the same partition types.
>> But ad0s4 partition has type DOSPTYP_EXT. And you got this error message.
> 
> Is it possible to detect whether a request has been forwarded?  I think
> there is also the possibility of foot shooting in the DOSPTYP_386BSD
> case and it would be nice to fix that as well.

Hi,

I think we can check bp->bio_from field, something like that (not tested):

-- 
WBR, Andrey V. Elsukov

--------------060705090304070700000607
Content-Type: text/plain;
 name="kerneldump.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="kerneldump.diff"

Index: head/sys/geom/part/g_part.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- head/sys/geom/part/g_part.c	(revision 231895)
+++ head/sys/geom/part/g_part.c	(working copy)
@@ -2113,9 +2193,14 @@ g_part_start(struct bio *bp)
 			/*
 			 * Check that the partition is suitable for kernel
 			 * dumps. Typically only swap partitions should be
-			 * used.
+			 * used. If request goes from the nested scheme we
+			 * allow dumping, because nested scheme allowed that.
 			 */
-			if (!G_PART_DUMPTO(table, entry)) {
+			if (table->gpt_depth =3D=3D 0 &&
+			    bp->bio_from !=3D NULL &&
+			    bp->bio_from->geom->class !=3D &g_part_class) {
+				/* FALLTHROUGH */
+			} else if (G_PART_DUMPTO(table, entry) =3D=3D 0) {
 				g_io_deliver(bp, ENODEV);
 				printf("GEOM_PART: Partition '%s' not suitable"
 				    " for kernel dumps (wrong type?)\n",

--------------060705090304070700000607--



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