diff options
| author | fvdl <fvdl@NetBSD.org> | 2001-01-08 02:03:45 +0000 |
|---|---|---|
| committer | fvdl <fvdl@NetBSD.org> | 2001-01-08 02:03:45 +0000 |
| commit | d040bd590850dfb719beb134cf209576739b602d (patch) | |
| tree | 5b386191114a737a88cd9b1f476997d3c8b0223c /sys/dev/raidframe | |
| parent | 4d4b2b5626be9c933616b757c0e60ce377f69e72 (diff) | |
Return error in the case of using ODIOCGDINFO or ODIOCGDEFLABEL when
the number of partitions is > OLDMAXPARTITIONS. This is better
than silently truncating the label (don't want to silently throw
away partitions when using an old disklabel binary on a label with
> 8 partitions). From Enami Tsugutomo.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 7a71df1cffd..d557c0df31b 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.102 2001/01/07 18:09:02 fvdl Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.103 2001/01/08 02:03:47 fvdl Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -1459,7 +1459,7 @@ raidioctl(dev, cmd, data, flag, p) case ODIOCGDINFO: newlabel = *(rs->sc_dkdev.dk_label); if (newlabel.d_npartitions > OLDMAXPARTITIONS) - newlabel.d_npartitions = OLDMAXPARTITIONS; + return ENOTTY; memcpy(data, &newlabel, sizeof (struct olddisklabel)); break; #endif @@ -1528,7 +1528,7 @@ raidioctl(dev, cmd, data, flag, p) case ODIOCGDEFLABEL: raidgetdefaultlabel(raidPtr, rs, &newlabel); if (newlabel.d_npartitions > OLDMAXPARTITIONS) - newlabel.d_npartitions = OLDMAXPARTITIONS; + return ENOTTY; memcpy(data, &newlabel, sizeof (struct olddisklabel)); break; #endif |
