From owner-freebsd-arch@FreeBSD.ORG Sun Jan 8 21:13:53 2012 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99ED7106564A for ; Sun, 8 Jan 2012 21:13:53 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) by mx1.freebsd.org (Postfix) with ESMTP id 7AC438FC08 for ; Sun, 8 Jan 2012 21:13:53 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id q08KZjL5024434 for ; Sun, 8 Jan 2012 12:35:48 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201201082035.q08KZjL5024434@gw.catspoiler.org> Date: Sun, 8 Jan 2012 12:35:45 -0800 (PST) From: Don Lewis To: arch@FreeBSD.org MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: Subject: [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: Sun, 08 Jan 2012 21:13:53 -0000 I've got a machine that is set up to dual boot both FreeBSD and Linux. It is also disk space impaired, so to make the best use possible of the available space, I have FreeBSD set up to swap to the Linux swap partition. Until now I haven't had working crash dumps because geom didn't permit crash dumps to Linux swap partitions. This patch removes that limitation. This could be useful for users of laptops who boot multiple operating systems. Index: sys/geom/part/g_part_ebr.c =================================================================== --- sys/geom/part/g_part_ebr.c (revision 229800) +++ sys/geom/part/g_part_ebr.c (working copy) @@ -333,9 +333,10 @@ { 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) Index: sys/geom/part/g_part_mbr.c =================================================================== --- sys/geom/part/g_part_mbr.c (revision 229800) +++ sys/geom/part/g_part_mbr.c (working copy) @@ -304,9 +304,10 @@ { 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 Is anyone else disturbed by the foot shooting potential of allowing crash dumps to be written to 386BSD partitions?