Subject: Braindamage in arm/disksubr.c
To: None <port-arm@netbsd.org>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: port-arm
Date: 08/27/2002 10:29:18
--rS8CxjVDS/+yyDmU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Does anyone know the source of this?  Without the attached patch,
the ARM ports totally fail to use things like RAIDframe or CCD,
because the ARM disksubr is protecting the label sector relative to
"a", not RAW_PART ... so, even if you offset A, you end up getting a
bogus EROFS from bounds_check_with_label().

Things like FFS must just be getting extraordinarly lucky.  I'm surprised
this bug went unnoticed for so long.

If this is something acorn32 actually needs (I seriously doubt it), then
acorn32 should get its own disksubr.c, rather than pollute the rest of
the ARM code.

(I've checked in the patch.)

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>

--rS8CxjVDS/+yyDmU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=disksubr-patch

Index: disksubr.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/arm/arm/disksubr.c,v
retrieving revision 1.2
diff -u -r1.2 disksubr.c
--- disksubr.c	2002/02/19 17:09:42	1.2
+++ disksubr.c	2002/08/27 17:24:46
@@ -394,7 +394,7 @@
 	int wlabel;
 {
 	struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
-	int labelsector = lp->d_partitions[0].p_offset + LABELSECTOR;
+	int labelsector = lp->d_partitions[RAW_PART].p_offset + LABELSECTOR;
 	int sz;
 
 	sz = howmany(bp->b_bcount, lp->d_secsize);

--rS8CxjVDS/+yyDmU--