summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-10-25 19:02:48 +0000
committerbde <bde@FreeBSD.org>1998-10-25 19:02:48 +0000
commit5a7ea1209a9c22e10c1ec8e2ee7563850f5f7648 (patch)
tree377341bfd8426b70fa582e681abcaf9df695bce7 /sys
parent13c66194f4b66073c693cdb830b5091d9d735e17 (diff)
downloadFreeBSD-src-5a7ea1209a9c22e10c1ec8e2ee7563850f5f7648.zip
FreeBSD-src-5a7ea1209a9c22e10c1ec8e2ee7563850f5f7648.tar.gz
Don't follow null bdevsw pointers. The `major(dev) < nblkdev' test rotted
when bdevsw[] became sparse. We still depend on magic to avoid having to check that (v_rdev) device numbers in vnodes are not NODEV. Removed redundant `major(dev) < nblkdev' tests instead of updating them.
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 56f2070..fbfe118 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95
- * $Id: ffs_vfsops.c,v 1.88 1998/09/26 04:59:42 bde Exp $
+ * $Id: ffs_vfsops.c,v 1.89 1998/10/25 17:44:57 phk Exp $
*/
#include "opt_quota.h"
@@ -290,7 +290,8 @@ ffs_mount( mp, path, data, ndp, p)
err = ENOTBLK;
goto error_2;
}
- if (major(devvp->v_rdev) >= nblkdev) {
+ if (major(devvp->v_rdev) >= nblkdev ||
+ bdevsw[major(devvp->v_rdev)] == NULL) {
err = ENXIO;
goto error_2;
}
@@ -458,7 +459,7 @@ ffs_reload(mp, cred, p)
* Note that it is optional that the backing device be VMIOed. This
* increases the opportunity for metadata caching.
*/
- if ((devvp->v_type == VBLK) && (major(dev) < nblkdev)) {
+ if (devvp->v_type == VBLK) {
simple_lock(&devvp->v_interlock);
vfs_object_create(devvp, p, p->p_ucred, 0);
}
@@ -613,7 +614,7 @@ ffs_mountfs(devvp, mp, p, malloctype)
* Note that it is optional that the backing device be VMIOed. This
* increases the opportunity for metadata caching.
*/
- if ((devvp->v_type == VBLK) && (major(dev) < nblkdev)) {
+ if (devvp->v_type == VBLK) {
simple_lock(&devvp->v_interlock);
vfs_object_create(devvp, p, p->p_ucred, 0);
}
OpenPOWER on IntegriCloud