summaryrefslogtreecommitdiff
path: root/sys/kern/subr_diskslice.c
diff options
context:
space:
mode:
authorGreg Lehey <grog@FreeBSD.org>1999-06-21 03:48:16 +0000
committerGreg Lehey <grog@FreeBSD.org>1999-06-21 03:48:16 +0000
commit53a03d1c97590218458479f375b6adbfb3cb790d (patch)
tree092adfc1ad48cf89108d0e0f82b235ca78f3c074 /sys/kern/subr_diskslice.c
parent378949dbcae85fd56a37d74577140d2a7b9bcbbb (diff)
Notes
Diffstat (limited to 'sys/kern/subr_diskslice.c')
-rw-r--r--sys/kern/subr_diskslice.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c
index 2a5581910a4b..ea4a2a6c8e04 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.63 1999/05/09 11:27:41 dfr Exp $
+ * $Id: subr_diskslice.c,v 1.64 1999/05/11 19:54:30 phk Exp $
*/
#include "opt_devfs.h"
@@ -729,8 +729,12 @@ dsopen(dname, dev, mode, flags, sspp, lp, strat, setgeom, cdevsw)
struct diskslices *ssp;
int unit;
- if (lp->d_secsize % DEV_BSIZE)
+ unit = dkunit(dev);
+ if (lp->d_secsize % DEV_BSIZE) {
+ printf("%s%d: invalid sector size %lu\n", dname, unit,
+ (u_long)lp->d_secsize);
return (EINVAL);
+ }
/*
* XXX reinitialize the slice table unless there is an open device
@@ -796,8 +800,6 @@ dsopen(dname, dev, mode, flags, sspp, lp, strat, setgeom, cdevsw)
}
}
- unit = dkunit(dev);
-
/*
* Initialize secondary info for all slices. It is needed for more
* than the current slice in the DEVFS case.