Re: FreeBSD 5.3-BETA6 available

From: David Malone <dwmalone_at_maths.tcd.ie>
Date: Tue, 28 Sep 2004 14:51:24 +0100
> > 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
_at__at_ -142,6 +142,7 _at__at_
 	struct disklabel *lp;
 	char *msg;
 	long	nsec;
+	off_t offset;
 	struct partition *pp;
 	daddr_t	secno;
 	daddr_t	slicerel_secno;
_at__at_ -153,6 +154,20 _at__at_
 		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)];
Received on Tue Sep 28 2004 - 11:51:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:14 UTC