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
[-- Attachment #1 --]
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
[-- Attachment #2 --]
Index: head/sys/geom/part/g_part.c
===================================================================
--- 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 == 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",
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F3FE4D2.4090803>
