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
MFC after:	2 weeks
This commit is contained in:
Don Lewis 2012-01-13 18:32:56 +00:00
parent ad71f089ab
commit b5bad28182
2 changed files with 6 additions and 4 deletions

View File

@ -333,9 +333,10 @@ g_part_ebr_dumpto(struct g_part_table *table, struct g_part_entry *baseentry)
{
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)

View File

@ -304,9 +304,10 @@ g_part_mbr_dumpto(struct g_part_table *table, struct g_part_entry *baseentry)
{
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