summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_diskslice.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-10-17 09:46:42 +0000
committerbde <bde@FreeBSD.org>1998-10-17 09:46:42 +0000
commit1be558ae51a3c6c5b108d0b9f235c554e6bc71d0 (patch)
tree7369e0c69d61510395092f52295298928927ea70 /sys/kern/subr_diskslice.c
parent19b83af2927dac7935f3437f09668e2c107172b6 (diff)
downloadFreeBSD-src-1be558ae51a3c6c5b108d0b9f235c554e6bc71d0.zip
FreeBSD-src-1be558ae51a3c6c5b108d0b9f235c554e6bc71d0.tar.gz
Overload the correct errno for attempts to set an in-core label with
a raw partition at a nonzero offset (EINVAL should have been EXDEV; DIOCSDINFO was broken, and DIOCWDINFO was broken because it depended on DIOCSDINFO). A zero offset for the raw partition should probably be enforced in setdisklabel(), and DIOCWDINFO should probably always be handled by first calling setdisklabel() so that writedisklabel() doesn't need to enforce it, but this has never been done; dsioctl() has a special check. Changes in this commit are limited to dsioctl() to preserve bug for bug compatibility in drivers that don't use the slice code (notably the ccd driver, which allows setting a bogus label in DIOCWDINFO and doesn't undo the setting when writedisklabel() fails).
Diffstat (limited to 'sys/kern/subr_diskslice.c')
-rw-r--r--sys/kern/subr_diskslice.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c
index d02b6b2..83590e6 100644
--- a/sys/kern/subr_diskslice.c
+++ b/sys/kern/subr_diskslice.c
@@ -43,7 +43,7 @@
* from: wd.c,v 1.55 1994/10/22 01:57:12 phk Exp $
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
- * $Id: subr_diskslice.c,v 1.57 1998/08/13 08:09:07 dfr Exp $
+ * $Id: subr_diskslice.c,v 1.58 1998/08/23 20:16:34 phk Exp $
*/
#include "opt_devfs.h"
@@ -464,7 +464,7 @@ dsioctl(dname, dev, cmd, data, flags, sspp, strat, setgeom)
(u_long)openmask);
/* XXX why doesn't setdisklabel() check this? */
if (error == 0 && lp->d_partitions[RAW_PART].p_offset != 0)
- error = EINVAL;
+ error = EXDEV;
if (error == 0) {
if (lp->d_secperunit > sp->ds_size)
error = ENOSPC;
OpenPOWER on IntegriCloud