[patch] allow crash dumps to Linux swap partitions
Doug Barton
dougb at FreeBSD.org
Sun Feb 19 00:46:23 UTC 2012
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/
-------------- next part --------------
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",
More information about the freebsd-arch
mailing list