ATAPI-CD corruption since GEOMification (& possible fix)

From: Peter Edwards <pmedwards_at_eircom.net>
Date: Sat, 8 Nov 2003 22:10:20 +0000
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
_at__at_ -1018,7 +1018,7 _at__at_
        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.
Received on Sat Nov 08 2003 - 12:31:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:28 UTC