From owner-freebsd-current Fri Oct 4 21:11:21 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 53C1937B401; Fri, 4 Oct 2002 21:11:19 -0700 (PDT) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9BCD43E65; Fri, 4 Oct 2002 21:11:17 -0700 (PDT) (envelope-from grog@lemis.com) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id 7C7568147B; Sat, 5 Oct 2002 13:41:14 +0930 (CST) Date: Sat, 5 Oct 2002 13:41:14 +0930 From: Greg 'groggy' Lehey To: Robert Watson , Ian Dowse Cc: n0go013 , current Subject: Re: [ GEOM tests ] disklabel warnings and vinum drives lost Message-ID: <20021005041114.GL83766@wantadilla.lemis.com> References: <200210050310.ab54012@salmon.maths.tcd.ie> <200210050408.aa61102@salmon.maths.tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200210050408.aa61102@salmon.maths.tcd.ie> User-Agent: Mutt/1.4i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Saturday, 5 October 2002 at 4:08:19 +0100, Ian Dowse wrote: > > [CCs trimmed] > >> The divide by zero problem seems to be caused by an interaction >> between two bugs: GEOM refuses to return the sector size because > ... >> The next failure I get is: >> >> Can't write config to /dev/da1s1d, error 45 (EOPNOTSUPP) > > This turns out to be vinum doing a DIOCWLABEL to make the label > writable before writing its configuration, but GEOM does not support > that ioctl I presume. It should be safe to ignore these DIOCWLABEL > ioctl return values as the actual writing of the vinum data should > give a suitable error if making the label writable fails and is > important. The patch below is Robert's patch with all 3 other issues > fixed, and together, this seems to be enough to make vinum work > again. > @@ -678,20 +615,18 @@ > if ((drive->state != drive_unallocated) > && (drive->state != drive_referenced)) { /* and it's a real drive */ > wlabel_on = 1; /* enable writing the label */ > - error = (*devsw(drive->dev)->d_ioctl) (drive->dev, /* make the label writeable */ > + (void) (*devsw(drive->dev)->d_ioctl) (drive->dev, /* make the label writeable */ > DIOCWLABEL, > (caddr_t) & wlabel_on, > FWRITE, > curthread); > - if (error == 0) > - error = write_drive(drive, (char *) vhdr, VINUMHEADERLEN, VINUM_LABEL_OFFSET); > + error = write_drive(drive, (char *) vhdr, VINUMHEADERLEN, VINUM_LABEL_OFFSET); > if (error == 0) > error = write_drive(drive, config, MAXCONFIG, VINUM_CONFIG_OFFSET); /* first config copy */ > if (error == 0) > error = write_drive(drive, config, MAXCONFIG, VINUM_CONFIG_OFFSET + MAXCONFIG); /* second copy */ > wlabel_on = 0; /* enable writing the label */ > - if (error == 0) > - error = (*devsw(drive->dev)->d_ioctl) (drive->dev, /* make the label non-writeable again */ > + (void) (*devsw(drive->dev)->d_ioctl) (drive->dev, /* make the label non-writeable again */ > DIOCWLABEL, > (caddr_t) & wlabel_on, > FWRITE, I don't know how GEOM handles disk labels, though we've heard a lot about changes. It's possible that this code is now completely redundant. It's preparing to write at offset 8 sectors and on from the beginning of the partition; it would be worth checking what happens if you just remove the whole disk label writeable stuff. Greg -- See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message