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 <[EMAIL PROTECTED]>
--- /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;
                }

Reply via email to