From owner-freebsd-arch@FreeBSD.ORG Sat Feb 18 17:50:18 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 E2A97106564A; Sat, 18 Feb 2012 17:50:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 5B0FE15106E; Sat, 18 Feb 2012 17:50:16 +0000 (UTC) Message-ID: <4F3FE4D2.4090803@FreeBSD.org> Date: Sat, 18 Feb 2012 21:50:10 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120105 Thunderbird/9.0 MIME-Version: 1.0 To: Don Lewis References: <201202171857.q1HIvZcC011615@gw.catspoiler.org> In-Reply-To: <201202171857.q1HIvZcC011615@gw.catspoiler.org> X-Enigmail-Version: undefined OpenPGP: id=10C8A17A Content-Type: multipart/mixed; boundary="------------060705090304070700000607" Cc: arch@FreeBSD.org, dougb@FreeBSD.org 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: Sat, 18 Feb 2012 17:50:19 -0000 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--