From owner-freebsd-current@FreeBSD.ORG Sat Nov 8 13:31:40 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8D6E816A4CE for ; Sat, 8 Nov 2003 13:31:40 -0800 (PST) Received: from mail01.svc.cra.dublin.eircom.net (mail01.svc.cra.dublin.eircom.net [159.134.118.17]) by mx1.FreeBSD.org (Postfix) with SMTP id 8791C43FAF for ; Sat, 8 Nov 2003 13:31:39 -0800 (PST) (envelope-from pmedwards@eircom.net) Received: (qmail 91937 messnum 3204817 invoked from network[159.134.237.90/webmail05.eircom.net]); 8 Nov 2003 21:31:38 -0000 Received: from webmail05.eircom.net (HELO webmail.eircom.net) (159.134.237.90) by mail01.svc.cra.dublin.eircom.net (qp 91937) with SMTP; 8 Nov 2003 21:31:38 -0000 From: "Peter Edwards" To: current@freebsd.org Date: Sat, 8 Nov 2003 22:10:20 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-Originating-IP: 194.125.183.14 X-Mailer: Eircom Net CRC Webmail (http://www.eircom.net/) Organization: Eircom Net (http://www.eircom.net/) Message-Id: <20031108213139.8791C43FAF@mx1.FreeBSD.org> Subject: ATAPI-CD corruption since GEOMification (& possible fix) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2003 21:31:40 -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 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.