From 9d99f4693f55168cc078dc6a8322fa17e7edcc89 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 23 Jul 2007 19:53:34 +0000 Subject: [PATCH] dssetmask() was being called too early, causing the disk layer to believe the disk was open when in fact it was not, in certain cases where the disk open fails. --- sys/kern/subr_diskslice.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c index 58f249571a..364e1fad6d 100644 --- a/sys/kern/subr_diskslice.c +++ b/sys/kern/subr_diskslice.c @@ -44,7 +44,7 @@ * 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 $ * $FreeBSD: src/sys/kern/subr_diskslice.c,v 1.82.2.6 2001/07/24 09:49:41 dd Exp $ - * $DragonFly: src/sys/kern/subr_diskslice.c,v 1.48 2007/06/19 06:07:57 dillon Exp $ + * $DragonFly: src/sys/kern/subr_diskslice.c,v 1.49 2007/07/23 19:53:34 dillon Exp $ */ #include @@ -914,7 +914,6 @@ dsopen(cdev_t dev, int mode, u_int flags, return (EINVAL); } } - dssetmask(sp, part); /* * Do not allow special raw-extension partitions to be opened @@ -926,6 +925,11 @@ dsopen(cdev_t dev, int mode, u_int flags, if ((info->d_dsflags & DSO_RAWEXTENSIONS) == 0) return (EINVAL); } + + /* + * Ok, we are open + */ + dssetmask(sp, part); return (0); } -- 2.41.0