Unix Technical Forum

Re: raidframe testing needed

This is a discussion on Re: raidframe testing needed within the mailing.openbsd.tech forums, part of the OpenBSD category; --> On Fri, Jun 01, 2007 at 11:16:52PM -0400, Kenneth R Westerback wrote: > Make raidframe do a more 'normal' ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 09:25 AM
Kenneth R Westerback
 
Posts: n/a
Default Re: raidframe testing needed

On Fri, Jun 01, 2007 at 11:16:52PM -0400, Kenneth R Westerback wrote:
> Make raidframe do a more 'normal' *getdisklabel() dance, a la sd.
> This allows the elimination of the last (?) RAW_PART manual
> initialization outside of readdisklabel().
>
> Compiles, but that's all I know. I need some adventurous raidframe
> user(s) to try this out and see if I've stomped on raidframe
> unwritten rules.
>
> .... Ken


Are there no adventurous raidframe users? If no one is able/willing
to test, this will have to be committed to be 'tested' involuntarily
at your next upgrade ...

..... Ken

>
> Index: rf_openbsdkintf.c
> ================================================== =================
> RCS file: /cvs/src/sys/dev/raidframe/rf_openbsdkintf.c,v
> retrieving revision 1.35
> diff -u -p -r1.35 rf_openbsdkintf.c
> --- rf_openbsdkintf.c 28 Apr 2007 12:32:13 -0000 1.35
> +++ rf_openbsdkintf.c 2 Jun 2007 02:07:36 -0000
> @@ -270,7 +270,7 @@ struct raid_softc **raid_scPtrs;
>
> 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 @@ raidopen(dev_t dev, int flags, int fmt,
> {
> int unit = DISKUNIT(dev);
> struct raid_softc *rs;
> - struct disklabel *lp;
> int part,pmask;
> int error = 0;
>
> @@ -633,7 +632,6 @@ raidopen(dev_t dev, int flags, int fmt,
>
> if ((error = raidlock(rs)) != 0)
> return (error);
> - lp = rs->sc_dkdev.dk_label;
>
> part = DISKPART(dev);
> pmask = (1 << part);
> @@ -643,15 +641,17 @@ raidopen(dev_t dev, int flags, int fmt,
>
>
> 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 @@ raidioctl(dev_t dev, u_long cmd, caddr_t
> 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;
> @@ -2111,11 +2113,6 @@ raidgetdefaultlabel(RF_Raid_t *raidPtr,
> lp->d_interleave = 1;
> lp->d_flags = 0;
>
> - lp->d_partitions[RAW_PART].p_offset = 0;
> - lp->d_partitions[RAW_PART].p_size = 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;
> lp->d_checksum = dkcksum(rs->sc_dkdev.dk_label);
> @@ -2126,19 +2123,19 @@ raidgetdefaultlabel(RF_Raid_t *raidPtr,
> * 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];
> @@ -2149,7 +2146,7 @@ raidgetdisklabel(dev_t dev)
> * 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;


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:27 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com