1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

- Fix "end_blk out of range" panic when INVARIANTS.

- Do not allow rw access.

Submitted by:	Dario Freni <saturnero at freesbie dot org>
MFC after:	3 days
This commit is contained in:
Max Khon 2005-09-29 22:45:16 +00:00
parent 1d12d2a87f
commit f3b5092061
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=150735

View File

@ -238,9 +238,9 @@ g_uzip_start(struct bio *bp)
start_blk = bp->bio_offset / sc->blksz;
end_blk = (bp->bio_offset + bp->bio_length + sc->blksz - 1) / sc->blksz;
KASSERT(start_blk <= sc->nblocks,
KASSERT(start_blk < sc->nblocks,
("start_blk out of range"));
KASSERT(end_blk < sc->nblocks,
KASSERT(end_blk <= sc->nblocks,
("end_blk out of range"));
sc->req_total++;
@ -321,6 +321,9 @@ g_uzip_access(struct g_provider *pp, int dr, int dw, int de)
cp = LIST_FIRST(&gp->consumer);
KASSERT (cp != NULL, ("g_uzip_access but no consumer"));
if (cp->acw + dw > 0)
return EROFS;
return (g_access(cp, dr, dw, de));
}