On Mon, Jun 11, 2007 at 03:01:03PM -0400, I wrote: > ...so it looks like the patch in tech@ is my next step.
I have retrofitted it for rev 1.39, but it did not eliminate my problem. :( Index: rf_openbsdkintf.c =================================================================== RCS file: /home/cvs/src/sys/dev/raidframe/rf_openbsdkintf.c,v retrieving revision 1.39 diff -u -r1.39 rf_openbsdkintf.c --- rf_openbsdkintf.c 8 Jun 2007 05:27:58 -0000 1.39 +++ rf_openbsdkintf.c 11 Jun 2007 20:26:46 -0000 @@ -270,7 +270,7 @@ void rf_shutdown_hook(RF_ThreadArg_t); void raidgetdefaultlabel(RF_Raid_t *, struct raid_softc *, struct disklabel *); -void raidgetdisklabel(dev_t); +void raidgetdisklabel(dev_t, struct disklabel *, struct cpu_disklabel *, int); void raidmakedisklabel(struct raid_softc *); int raidlock(struct raid_softc *); @@ -623,7 +623,6 @@ { int unit = DISKUNIT(dev); struct raid_softc *rs; - struct disklabel *lp; int part,pmask; int error = 0; @@ -633,7 +632,6 @@ if ((error = raidlock(rs)) != 0) return (error); - lp = rs->sc_dkdev.dk_label; part = DISKPART(dev); pmask = (1 << part); @@ -643,15 +641,17 @@ if ((rs->sc_flags & RAIDF_INITED) && (rs->sc_dkdev.dk_openmask == 0)) - raidgetdisklabel(dev); + raidgetdisklabel(dev, rs->sc_dkdev.dk_label, + rs->sc_dkdev.dk_cpulabel, 0); /* Make sure that this partition exists. */ if (part != RAW_PART) { db1_printf(("Not a raw partition..\n")); if (((rs->sc_flags & RAIDF_INITED) == 0) || - ((part >= lp->d_npartitions) || - (lp->d_partitions[part].p_fstype == FS_UNUSED))) { + ((part >= rs->sc_dkdev.dk_label->d_npartitions) || + (rs->sc_dkdev.dk_label->d_partitions[part].p_fstype == + FS_UNUSED))) { error = ENXIO; raidunlock(rs); db1_printf(("Bailing out...\n")); @@ -1601,9 +1601,11 @@ rs->sc_flags &= ~RAIDF_WLABEL; break; - case DIOCGPDINFO: - raidgetdefaultlabel(raidPtr, rs, (struct disklabel *) data); - break; + case DIOCGPDINFO: { + struct cpu_disklabel osdep; + raidgetdisklabel(dev, (struct disklabel *)data, &osdep, 1); + break; + } default: retcode = ENOTTY; @@ -2112,10 +2114,6 @@ lp->d_interleave = 1; lp->d_version = 1; - DL_SETPOFFSET(&lp->d_partitions[RAW_PART], 0); - DL_SETPSIZE(&lp->d_partitions[RAW_PART], raidPtr->totalSectors); - lp->d_partitions[RAW_PART].p_fstype = FS_UNUSED; - lp->d_npartitions = RAW_PART + 1; lp->d_magic = DISKMAGIC; lp->d_magic2 = DISKMAGIC; @@ -2127,19 +2125,19 @@ * If one is not present, fake one up. */ void -raidgetdisklabel(dev_t dev) +raidgetdisklabel(dev_t dev, struct disklabel *lp, struct cpu_disklabel *clp, + int spoofonly) { int unit = DISKUNIT(dev); struct raid_softc *rs = &raid_softc[unit]; char *errstring; - struct disklabel *lp = rs->sc_dkdev.dk_label; - struct cpu_disklabel *clp = rs->sc_dkdev.dk_cpulabel; RF_Raid_t *raidPtr; int i; struct partition *pp; db1_printf(("Getting the disklabel...\n")); + bzero(lp, sizeof(*lp)); bzero(clp, sizeof(*clp)); raidPtr = raidPtrs[unit]; @@ -2150,7 +2148,7 @@ * Call the generic disklabel extraction routine. */ errstring = readdisklabel(DISKLABELDEV(dev), raidstrategy, lp, - rs->sc_dkdev.dk_cpulabel, 0); + clp, spoofonly); if (errstring) { /*printf("%s: %s\n", rs->sc_xname, errstring);*/ return;