From d040bd590850dfb719beb134cf209576739b602d Mon Sep 17 00:00:00 2001 From: fvdl Date: Mon, 8 Jan 2001 02:03:45 +0000 Subject: 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. --- sys/dev/raidframe/rf_netbsdkintf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/dev/raidframe') 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 -- cgit