From 7d15435cb1400fe65b0009a38bd7f69526052571 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Sun, 15 Feb 1998 08:14:39 +0000 Subject: [PATCH] missing spl() call and off by one error in the handling of the partitions. Submitted by: Chris Csanady Obtained from: OpenBSD --- sys/dev/ccd/ccd.c | 5 +++-- sys/geom/geom_ccd.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c index bbd3871cb70..5ec5f3d6943 100644 --- a/sys/dev/ccd/ccd.c +++ b/sys/dev/ccd/ccd.c @@ -1,4 +1,4 @@ -/* $Id: ccd.c,v 1.27 1997/11/18 14:39:04 phk Exp $ */ +/* $Id: ccd.c,v 1.28 1998/01/31 03:19:06 eivind Exp $ */ /* $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */ @@ -631,7 +631,7 @@ ccdopen(dev, flags, fmt, p) ccdgetdisklabel(dev); /* Check that the partition exists. */ - if (part != RAW_PART && ((part > lp->d_npartitions) || + if (part != RAW_PART && ((part >= lp->d_npartitions) || (lp->d_partitions[part].p_fstype == FS_UNUSED))) { error = ENXIO; goto done; @@ -938,6 +938,7 @@ ccdintr(cs, bp) register struct buf *bp; { + s = splbio(); #ifdef DEBUG if (ccddebug & CCDB_FOLLOW) printf("ccdintr(%x, %x)\n", cs, bp); diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c index bbd3871cb70..5ec5f3d6943 100644 --- a/sys/geom/geom_ccd.c +++ b/sys/geom/geom_ccd.c @@ -1,4 +1,4 @@ -/* $Id: ccd.c,v 1.27 1997/11/18 14:39:04 phk Exp $ */ +/* $Id: ccd.c,v 1.28 1998/01/31 03:19:06 eivind Exp $ */ /* $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */ @@ -631,7 +631,7 @@ ccdopen(dev, flags, fmt, p) ccdgetdisklabel(dev); /* Check that the partition exists. */ - if (part != RAW_PART && ((part > lp->d_npartitions) || + if (part != RAW_PART && ((part >= lp->d_npartitions) || (lp->d_partitions[part].p_fstype == FS_UNUSED))) { error = ENXIO; goto done; @@ -938,6 +938,7 @@ ccdintr(cs, bp) register struct buf *bp; { + s = splbio(); #ifdef DEBUG if (ccddebug & CCDB_FOLLOW) printf("ccdintr(%x, %x)\n", cs, bp); -- 2.45.2