svn commit: r217389 - projects/graid/head/sys/geom/raid
Warner Losh
imp at FreeBSD.org
Fri Jan 14 05:25:45 UTC 2011
Author: imp
Date: Fri Jan 14 05:25:44 2011
New Revision: 217389
URL: http://svn.freebsd.org/changeset/base/217389
Log:
Fix bug in overlaps that Pawel pointed out.
Modified:
projects/graid/head/sys/geom/raid/g_raid.c
Modified: projects/graid/head/sys/geom/raid/g_raid.c
==============================================================================
--- projects/graid/head/sys/geom/raid/g_raid.c Fri Jan 14 04:24:53 2011 (r217388)
+++ projects/graid/head/sys/geom/raid/g_raid.c Fri Jan 14 05:25:44 2011 (r217389)
@@ -733,7 +733,7 @@ g_raid_start(struct bio *bp)
}
static int
-g_raid_bio_overlaps(const struct bio *bp, off_t off, off_t len)
+g_raid_bio_overlaps(const struct bio *bp, off_t lstart, off_t len)
{
/*
* 5 cases:
@@ -750,10 +750,13 @@ g_raid_bio_overlaps(const struct bio *bp
* (4) 12-14: passes both ifs
* (5) 19-20: passes both
*/
+ off_t lend = lstart + len - 1;
+ off_t bstart = bp->bio_offset;
+ off_t bend = bp->bio_offset + bp->bio_length - 1;
- if (bp->bio_offset + bp->bio_length - 1 < off)
+ if (bend < lstart)
return (0);
- if (bp->bio_offset < off + len - 1)
+ if (lend < bstart)
return (0);
return (1);
}
More information about the svn-src-projects
mailing list