[Debburn-devel] Possible bug in 4GiB filesize check

Thomas Schmitt scdbackup at gmx.net
Thu Jun 13 14:09:09 UTC 2013


Hi,

out of curiosity i followed the hint about pre-formatted BD-R.
The beef seems to be in growisofs_mmc.cpp.

When examining a drive with BD-R medium, it does

  int get_mmc_profile (void *fd)
  ...
        if (profile==0x41)      // BD-R SRM
        {   // Check for POW feature...
  ...
            cmd[0] = 0x46;      // GET CONFIGURATION
            cmd[1] = 2;         // ask for the only feature...
            cmd[3] = 0x38;      // the "BD-R Pseudo-Overwrite" one
            cmd[8] = 16;        // The feature should be there, right?
  ...
            if (err==0 &&
                (header[0]<<24|header[1]<<16|header[2]<<8|header[3])>=12 &&
                (header[8+2]&1)==1)
                bdr_plus_pow=1;
        }
  
Formatting is done by

  static void bd_r_format (Scsi_Command &cmd)
  ...
    descr[4+4]&=~3;     // ensure "Format Subtype" is set to SRM+POW

    f = descr+4;
    fprintf (stderr,"%s: pre-formatting blank BD-R for %.1fGB...\n",
                    ioctl_device,(f[0]<<24|f[1]<<16|f[2]<<8|f[3])*2048.0/1e9);

    cmd[0] = 0x04;      // FORMAT UNIT
  ...


If i understand the Sensei correctly, then the latter occasion is
simply lacking a
    bdr_plus_pow=1;
so that the further program stages know that it is now formatted
SRM+POW and not blank SRM any more. 

An appropriate place in the code would be in line 759
quite directly after performing the SCSI command  FORMAT UNIT:

    if ((err=cmd.transport(WRITE,descr,sizeof(descr))))
        sperror ("FORMAT UNIT",err),
        exit (FATAL_START(errno));

    wait_for_unit (cmd);

+   bdr_plus_pow=1;
+
    cmd[0] = 0x35;      // FLUSH CACHE
    cmd[9] = 0;
    cmd.transport();


Well ... it does still compile if i add that line.

So who is willing to use up a blank unformatted BD-R medium and
try whether the burn run ends without frowny
  ":-[ CLOSE SESSION failed" ?

(I'd lose a few potential users that way. But growisofs deserves
 loving care. It once served me as tutorial when i learned MMC
 for DVD media.)


Have a nice day :)

Thomas




More information about the Debburn-devel mailing list