diff options
author | jkh <jkh@FreeBSD.org> | 1994-10-27 20:45:13 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1994-10-27 20:45:13 +0000 |
commit | 1ca2f392e18c355a8108c5c84aa5e4705aedc786 (patch) | |
tree | 0f822c63937b648594897abc7f741b0a112e7844 /sys/scsi/sd.c | |
parent | 6cc6dda103dfdc45f437f7bccf591034663fd883 (diff) | |
download | FreeBSD-src-1ca2f392e18c355a8108c5c84aa5e4705aedc786.zip FreeBSD-src-1ca2f392e18c355a8108c5c84aa5e4705aedc786.tar.gz |
Julian Elischer's disklabel fixes.
Diffstat (limited to 'sys/scsi/sd.c')
-rw-r--r-- | sys/scsi/sd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 6bfb807..2223b97 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992 * - * $Id: sd.c,v 1.36 1994/10/20 00:08:31 phk Exp $ + * $Id: sd.c,v 1.37 1994/10/23 21:27:57 wollman Exp $ */ #define SPLSD splbio @@ -67,7 +67,6 @@ int Debugger(const char *); #define WHOLE_DISK(unit) ( (unit << UNITSHIFT) + RAW_PART ) -extern char *readdisklabel(); errval sdgetdisklabel __P((unsigned char unit)); errval sd_get_parms __P((int unit, int flags)); void sdstrategy __P((struct buf *)); @@ -782,6 +781,10 @@ sdgetdisklabel(unsigned char unit) /* * Call the generic disklabel extraction routine */ + sd->flags |= SDHAVELABEL; /* chicken and egg problem */ + /* we need to pretend this disklabel */ + /* is real before we can read */ + /* real disklabel */ errstring = readdisklabel(makedev(0, (unit << UNITSHIFT) + RAW_PART), sdstrategy, &sd->disklabel @@ -792,10 +795,10 @@ sdgetdisklabel(unsigned char unit) #endif ); if (errstring) { + sd->flags &= ~SDHAVELABEL; /* not now we don't */ printf("sd%d: %s\n", unit, errstring); return ENXIO; } - sd->flags |= SDHAVELABEL; /* WE HAVE IT ALL NOW */ return ESUCCESS; } |