From daf0c2f6676042cd3c9584679e77a1372570b05f Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 23 Jul 2007 18:59:51 +0000 Subject: [PATCH] The disk layer must not inherit the D_TRACKCLOSE flag from the underlying device as this will confuse the disk layer's tracking of opens and closes. This bug caused the disk layer to lose track of which slices and partitions were open when a slice or partition was opened multiple times. --- sys/kern/kern_device.c | 4 ++-- sys/kern/subr_disk.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_device.c b/sys/kern/kern_device.c index 012a51bc6b..c0ba2ba6d2 100644 --- a/sys/kern/kern_device.c +++ b/sys/kern/kern_device.c @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/kern_device.c,v 1.26 2007/05/17 03:01:59 dillon Exp $ + * $DragonFly: src/sys/kern/kern_device.c,v 1.27 2007/07/23 18:59:50 dillon Exp $ */ #include #include @@ -514,7 +514,7 @@ dev_ops_add_override(cdev_t backing_dev, struct dev_ops *template, *ops = *template; ops->head.name = backing_ops->head.name; ops->head.maj = backing_ops->head.maj; - ops->head.flags = backing_ops->head.flags; + ops->head.flags |= backing_ops->head.flags & ~D_TRACKCLOSE; compile_dev_ops(ops); dev_ops_add(ops, mask, match); diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index 3321a91e40..b0994ea462 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -77,7 +77,7 @@ * @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/subr_disk.c,v 1.20.2.6 2001/10/05 07:14:57 peter Exp $ * $FreeBSD: src/sys/ufs/ufs/ufs_disksubr.c,v 1.44.2.3 2001/03/05 05:42:19 obrien Exp $ - * $DragonFly: src/sys/kern/subr_disk.c,v 1.37 2007/06/17 23:50:16 dillon Exp $ + * $DragonFly: src/sys/kern/subr_disk.c,v 1.38 2007/07/23 18:59:51 dillon Exp $ */ #include @@ -112,7 +112,7 @@ static d_dump_t diskdump; static LIST_HEAD(, disk) disklist = LIST_HEAD_INITIALIZER(&disklist); static struct dev_ops disk_ops = { - { "disk" }, + { "disk", 0, D_DISK }, .d_open = diskopen, .d_close = diskclose, .d_read = physread, -- 2.41.0