Date: Sat, 8 Nov 2003 22:10:20 +0000 From: "Peter Edwards" <pmedwards@eircom.net> To: current@freebsd.org Subject: ATAPI-CD corruption since GEOMification (& possible fix) Message-ID: <20031108213139.8791C43FAF@mx1.FreeBSD.org>
next in thread | raw e-mail | index | archive | help
With a -current built after atapi-cd was changed over to GEOM, reads from a filesystem mounted on a CD device are being corrupted, with junk being inserted into the file from offset 63489 onwards. I had a quick look around atapi-cd.c, and I think I spotted the problem: applying this patch certainly stopped the corruption I was seeing. Anyone else seeing this? Can someone verify that this is indeed the correct fix? My CD device probes as: acd1: CDRW <CW088D ATAPI CD-R/RW> at ata1-slave PIO4 If its of any interest. Index: atapi-cd.c =================================================================== RCS file: /usr/cvs/FreeBSD-CVS/src/sys/dev/ata/atapi-cd.c,v retrieving revision 1.152 diff -u -r1.152 atapi-cd.c --- atapi-cd.c 7 Nov 2003 08:31:09 -0000 1.152 +++ atapi-cd.c 8 Nov 2003 21:06:15 -0000 @@ -1018,7 +1018,7 @@ u_int pos, size = cdp->iomax - cdp->iomax % bp->bio_to->sectorsize; struct bio *bp2; - for (pos = 0; pos < bp->bio_length; pos += bp->bio_length) { + for (pos = 0; pos < bp->bio_length; pos += size) { if (!(bp2 = g_clone_bio(bp))) { bp->bio_error = ENOMEM; break; -- Peter Edwards.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031108213139.8791C43FAF>