From owner-freebsd-geom@FreeBSD.ORG Sun May 21 22:50:22 2006 Return-Path: X-Original-To: freebsd-geom@hub.freebsd.org Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 62CAF16A515 for ; Sun, 21 May 2006 22:50:22 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A300B43D45 for ; Sun, 21 May 2006 22:50:21 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k4LMoLfO081851 for ; Sun, 21 May 2006 22:50:21 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k4LMoLXi081850; Sun, 21 May 2006 22:50:21 GMT (envelope-from gnats) Date: Sun, 21 May 2006 22:50:21 GMT Message-Id: <200605212250.k4LMoLXi081850@freefall.freebsd.org> To: freebsd-geom@FreeBSD.org From: "Scott Ullrich" Cc: Subject: Re: bin/90093: fdisk(8) incapable of altering in-core geometry X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Scott Ullrich List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 May 2006 22:50:27 -0000 The following reply was made to PR bin/90093; it has been noted by GNATS. From: "Scott Ullrich" To: bug-followup@FreeBSD.org, cpressey@catseye.mine.nu Cc: Subject: Re: bin/90093: fdisk(8) incapable of altering in-core geometry Date: Sun, 21 May 2006 18:43:17 -0400 Hello, this patch seems to fix the problems outlined in this pr. I am not sure if this is the "correct" fix but it does ineed work. This patch was given to me by Olavi Kumpulainen and he asked me to follow up to the PR if it worked. I've also sent this patch to 2 other parties with the same problems and they reported that this fixed their issues as well. --- fdisk.c=09Wed Oct 5 03:16:39 2005 +++ fdisk-patched.c=09Tue May 16 14:36:51 2006 @@ -750,6 +750,7 @@ =09char fbuf[BUFSIZ]; =09int i, fdw; +=09close(fd);=09/* Give the GEOM layer exclusive access to the disk */ =09grq =3D gctl_get_handle(); =09gctl_ro_param(grq, "verb", -1, "write MBR"); =09gctl_ro_param(grq, "class", -1, "MBR"); @@ -760,13 +761,15 @@ =09=09q++; =09gctl_ro_param(grq, "geom", -1, q); =09gctl_ro_param(grq, "data", secsize, buf); -=09q =3D gctl_issue(grq); +=09q =3D gctl_issue(grq); =09if (q =3D=3D NULL) { =09=09gctl_free(grq); +=09=09open_disk(u_flag); =09=09return(0); =09} =09warnx("%s", q); =09gctl_free(grq); +=09open_disk(u_flag); =09 =09error =3D pwrite(fd, buf, secsize, (sector * 512)); =09if (error =3D=3D secsize)