Date: Sat, 5 Oct 2002 13:41:14 +0930 From: Greg 'groggy' Lehey <grog@FreeBSD.org> To: Robert Watson <rwatson@FreeBSD.ORG>, Ian Dowse <iedowse@maths.tcd.ie> Cc: n0go013 <ttz@blahdeblah.demon.co.uk>, current <freebsd-current@FreeBSD.ORG> Subject: Re: [ GEOM tests ] disklabel warnings and vinum drives lost Message-ID: <20021005041114.GL83766@wantadilla.lemis.com> In-Reply-To: <200210050408.aa61102@salmon.maths.tcd.ie> References: <200210050310.ab54012@salmon.maths.tcd.ie> <200210050408.aa61102@salmon.maths.tcd.ie>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021005041114.GL83766>
