diff options
author | grog <grog@FreeBSD.org> | 1999-06-21 03:48:16 +0000 |
---|---|---|
committer | grog <grog@FreeBSD.org> | 1999-06-21 03:48:16 +0000 |
commit | 196a4d4309a59da00ff90c59c9060393d4e7e00e (patch) | |
tree | 700c433a418ac9b06c18b0113f9e14132acb44ac /sys | |
parent | 0aac238e5bc985c58f911dcb295a89f18e5857cc (diff) | |
download | FreeBSD-src-196a4d4309a59da00ff90c59c9060393d4e7e00e.zip FreeBSD-src-196a4d4309a59da00ff90c59c9060393d4e7e00e.tar.gz |
dsopen: Print a message if the unit has an invalid sector size.
Reviewed-by: ken, bde
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_diskslice.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c index 2a55819..ea4a2a6 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. |