svn commit: r230763 - stable/9/sys/geom/part

Don Lewis truckman at FreeBSD.org
Mon Jan 30 07:20:52 UTC 2012


Author: truckman
Date: Mon Jan 30 07:20:52 2012
New Revision: 230763
URL: http://svn.freebsd.org/changeset/base/230763

Log:
  MFC r230064:
  
  Allow an MBR primary or extended Linux swap partition to be specified
  as the system dump device.  This was already allowed for GPT.  The Linux
  swap metadata at the beginning of the partition should not be disturbed
  because the crash dump is written at the end.
  
  Reviewed by:	alfred, pjd, marcel

Modified:
  stable/9/sys/geom/part/g_part_ebr.c
  stable/9/sys/geom/part/g_part_mbr.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/part/g_part_ebr.c
==============================================================================
--- stable/9/sys/geom/part/g_part_ebr.c	Mon Jan 30 05:45:11 2012	(r230762)
+++ stable/9/sys/geom/part/g_part_ebr.c	Mon Jan 30 07:20:52 2012	(r230763)
@@ -333,9 +333,10 @@ g_part_ebr_dumpto(struct g_part_table *t
 {
 	struct g_part_ebr_entry *entry;
 
-	/* Allow dumping to a FreeBSD partition only. */
+	/* Allow dumping to a FreeBSD partition or Linux swap partition only. */
 	entry = (struct g_part_ebr_entry *)baseentry;
-	return ((entry->ent.dp_typ == DOSPTYP_386BSD) ? 1 : 0);
+	return ((entry->ent.dp_typ == DOSPTYP_386BSD ||
+	    entry->ent.dp_typ == DOSPTYP_LINSWP) ? 1 : 0);
 }
 
 #if defined(GEOM_PART_EBR_COMPAT)

Modified: stable/9/sys/geom/part/g_part_mbr.c
==============================================================================
--- stable/9/sys/geom/part/g_part_mbr.c	Mon Jan 30 05:45:11 2012	(r230762)
+++ stable/9/sys/geom/part/g_part_mbr.c	Mon Jan 30 07:20:52 2012	(r230763)
@@ -304,9 +304,10 @@ g_part_mbr_dumpto(struct g_part_table *t
 {
 	struct g_part_mbr_entry *entry;
 
-	/* Allow dumping to a FreeBSD partition only. */
+	/* Allow dumping to a FreeBSD partition or Linux swap partition only. */
 	entry = (struct g_part_mbr_entry *)baseentry;
-	return ((entry->ent.dp_typ == DOSPTYP_386BSD) ? 1 : 0);
+	return ((entry->ent.dp_typ == DOSPTYP_386BSD ||
+	    entry->ent.dp_typ == DOSPTYP_LINSWP) ? 1 : 0);
 }
 
 static int


More information about the svn-src-stable-9 mailing list