FreeBSD 5.3-BETA6 available

David Malone dwmalone at maths.tcd.ie
Tue Sep 28 06:51:34 PDT 2004


> > Bruce suggests that this one is fixed in geom, which is now used
> > by default. If this is the case, I can close the PR.

> Please do not close the PR yet, the bug persists in FreeBSD
> 4.10-RELEASE-p3 (tested a few minutes ago) and probably also in 4.8.

Here's a quick attempt to port the patch that Bruce suggested. I
haven't been able to test it yet, but you might like to try it.

	David.

--- /usr/src/sys/kern/subr_diskslice.c	Fri Sep  7 21:45:00 2001
+++ subr_diskslice.c	Tue Sep 28 14:47:39 2004
@@ -142,6 +142,7 @@
 	struct disklabel *lp;
 	char *msg;
 	long	nsec;
+	off_t offset;
 	struct partition *pp;
 	daddr_t	secno;
 	daddr_t	slicerel_secno;
@@ -153,6 +154,20 @@
 		printf("dscheck(%s): negative b_blkno %ld\n", 
 		    devtoname(bp->b_dev), (long)blkno);
 		bp->b_error = EINVAL;
+		goto bad;
+	}
+	offset = bp->b_offset;
+	if (offset < 0) {
+		printf("dscheck(%s): negative b_offset %ld\n",
+		    devtoname(bp->b_dev), (long)offset);
+		bp->b_error = EINVAL;
+		goto bad;
+	}
+	if (offset % (uoff_t)DEV_BSIZE) {
+		printf(
+		    "dscheck(%s): b_offset %ld is not on a DEV_BSIZE boundary\n",
+		    devtoname(bp->b_dev), (long)offset);
+		bp->bio_error = EINVAL;
 		goto bad;
 	}
 	sp = &ssp->dss_slices[dkslice(bp->b_dev)];


More information about the freebsd-current mailing list