Date: Sun, 21 May 2006 22:50:21 GMT From: "Scott Ullrich" <sullrich@gmail.com> To: freebsd-geom@FreeBSD.org Subject: Re: bin/90093: fdisk(8) incapable of altering in-core geometry Message-ID: <200605212250.k4LMoLXi081850@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/90093; it has been noted by GNATS. From: "Scott Ullrich" <sullrich@gmail.com> 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 <olavi@ipunplugged.com> 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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605212250.k4LMoLXi081850>