From owner-freebsd-bugs@FreeBSD.ORG Wed Oct 22 11:40:21 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C7B1016A4B3 for ; Wed, 22 Oct 2003 11:40:21 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B890243FBF for ; Wed, 22 Oct 2003 11:40:19 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h9MIeJFY047256 for ; Wed, 22 Oct 2003 11:40:19 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h9MIeJ6j047255; Wed, 22 Oct 2003 11:40:19 -0700 (PDT) (envelope-from gnats) Resent-Date: Wed, 22 Oct 2003 11:40:19 -0700 (PDT) Resent-Message-Id: <200310221840.h9MIeJ6j047255@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Martin Faxer Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C20416A4B3 for ; Wed, 22 Oct 2003 11:39:27 -0700 (PDT) Received: from lockdown.spectrum.fearmuffs.net (c-ed8870d5.010-2114-67626719.cust.bredbandsbolaget.se [213.112.136.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id B638E43FD7 for ; Wed, 22 Oct 2003 11:39:22 -0700 (PDT) (envelope-from redpixel@lockdown.spectrum.fearmuffs.net) Received: from lockdown.spectrum.fearmuffs.net (localhost [127.0.0.1]) h9MIdUkF001258 for ; Wed, 22 Oct 2003 20:39:31 +0200 (CEST) (envelope-from redpixel@lockdown.spectrum.fearmuffs.net) Received: (from redpixel@localhost)h9MIdQtj001257; Wed, 22 Oct 2003 20:39:26 +0200 (CEST) (envelope-from redpixel) Message-Id: <200310221839.h9MIdQtj001257@lockdown.spectrum.fearmuffs.net> Date: Wed, 22 Oct 2003 20:39:26 +0200 (CEST) From: Martin Faxer To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/58390: bsdlabel fails to display an error message if the label could not be written X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Martin Faxer List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2003 18:40:22 -0000 >Number: 58390 >Category: bin >Synopsis: bsdlabel fails to display an error message if the label could not be written >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Oct 22 11:40:18 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Martin Faxer >Release: FreeBSD 5.1-CURRENT-20031018-JPSNAP i386 >Organization: >Environment: System: FreeBSD lockdown.spectrum.fearmuffs.net 5.1-CURRENT-20031018-JPSNAP FreeBSD 5.1-CURRENT-20031018-JPSNAP #0: Mon Oct 20 15:21:10 CEST 2003 redpixel@lockdown.spectrum.fearmuffs.net:/usr/obj/usr/src/sys/LOCKDOWN i386 >Description: bsdlabel fails to display any kind of error message when opening the special device fails. this might lead one to believe that the label was written when it infact wasn't. quite annoying! >How-To-Repeat: run bsdlabel on any special device that is bound to fail (eg. a currently mounted disk) and try to save the label. no error messages will appear but the label will not get written to disk. >Fix: apply the patch below. (i'm not really sure what all that geom code is trying to accomplish, since the device can't be opened... as far as i know my system is geom but the code path taken in successful editing seems to be the write()) --- bsdlabel.diff begins here --- Index: sbin/bsdlabel/bsdlabel.c =================================================================== RCS file: /home/ncvs/src/sbin/bsdlabel/bsdlabel.c,v retrieving revision 1.103 diff -u -r1.103 bsdlabel.c --- sbin/bsdlabel/bsdlabel.c 18 Oct 2003 19:32:35 -0000 1.103 +++ sbin/bsdlabel/bsdlabel.c 22 Oct 2003 18:34:16 -0000 @@ -383,6 +383,7 @@ fd = open(specname, O_RDWR); if (fd < 0) { + warn("updated label could not be written to disk"); grq = gctl_get_handle(); gctl_ro_param(grq, "verb", -1, "write label"); gctl_ro_param(grq, "class", -1, "BSD"); --- bsdlabel.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: