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 [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message