From owner-freebsd-hackers Sun Sep 9 0:54:24 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from robin.mail.pas.earthlink.net (robin.mail.pas.earthlink.net [207.217.120.65]) by hub.freebsd.org (Postfix) with ESMTP id 310C937B401; Sun, 9 Sep 2001 00:54:20 -0700 (PDT) Received: from sm.socccd.cc.ca.us (pool0056.cvx15-bradley.dialup.earthlink.net [209.179.44.56]) by robin.mail.pas.earthlink.net (8.11.5/8.9.3) with ESMTP id f897sIa17803; Sun, 9 Sep 2001 00:54:18 -0700 (PDT) Message-ID: <3B9B20D8.5393D4E@sm.socccd.cc.ca.us> Date: Sun, 09 Sep 2001 00:57:12 -0700 From: Farooq Mela X-Mailer: Mozilla 4.76 [en] (X11; U; FreeBSD 4.4-RC i386) X-Accept-Language: en MIME-Version: 1.0 To: FreeBSD-Hackers@FreeBSD.ORG Cc: sos@FreeBSD.ORG Subject: Failure to fixate cd in burncd Content-Type: multipart/mixed; boundary="------------2C67590429291780833B3BCB" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------2C67590429291780833B3BCB Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, Sometimes when I burn data CD's from ISO's at 12x speed like so: # burncd -f /dev/acd1c -s 12 data file.iso fixate The fixate fails, and I believe it is because the CD-R has not yet spun down from the burn phase. The problem doesn't occur when the burn is done at a lower speed. The fixate works perfectly if, immediately after the 12x speed burn, I then do "burncd -f /dev/acd1c -s 12 fixate," because then the CD-R has stopped doing the burning phase. I don't know that much about ATA or anything, but I have attached a patch for burncd (against -STABLE) which will perhaps fix the problem (it does for me at least). It just retries the CDRIOCCLOSEDISK ioctl (which is the ioctl that fails) a few times, with pauses in between. Any thoughts? BTW, don't EVER try mounting a CD that has an .iso image burned to it but hasn't been fixated. There is a fatal kernel trap, and then somewhere in the code that handles kernel traps, there is another fatal trap, so there is a continuous barrage of kernel trap messages and information; these go on indefinitely until you press a key. -- farooq --------------2C67590429291780833B3BCB Content-Type: text/plain; charset=us-ascii; name="burncd.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="burncd.txt" --- /usr/src/usr.sbin/burncd/burncd.c Sat Mar 3 23:59:34 2001 +++ burncd.c Sun Sep 9 00:47:25 2001 @@ -118,9 +118,16 @@ for (arg = 0; arg < argc; arg++) { if (!strcmp(argv[arg], "fixate")) { + int retries; + if (!quiet) fprintf(stderr, "fixating CD, please wait..\n"); - if (ioctl(fd, CDRIOCCLOSEDISK, &multi) < 0) + for (retries = 5; retries; retries--) { + if (ioctl(fd, CDRIOCCLOSEDISK, &multi) == 0) + break; + usleep(100000); + } + if (retries == 0) err(EX_IOERR, "ioctl(CDRIOCCLOSEDISK)"); break; } --------------2C67590429291780833B3BCB-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message