[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: growisofs failing on some iso files



Hi,

> This write command itself is correct, but the "size of data in buffer" is
> passed incorrectly -- see the following patch, it fixes the problem at least
> on my testing data and seems much more rational than the previous one.
>
> -       if (!(errcode=cmd.transport (WRITE,(void *)buff,size)))
> +       if (!(errcode=cmd.transport (WRITE,(void *)buff,nbl*2048)))

Oh yes. This is a very plausible suspect:

    nbl = (unsigned int)(size/2048);
    ...
    if (dao_blocks!=0 && (lba+nbl)>dao_blocks)
        nbl = dao_blocks-lba;
    
With the last WRITE command we can get off track indeed.
growisofs.c calls (*pwrite64_method) == poor_mans_pwrite64 always
with size == DVD_BLOCK == (32*1024).


But why did your initially reported run fail so early ?

> > > :-[ WRITE@LBA=350h failed with SK=0h/ASC=00h/ACQ=03h]: Input/output 
> > > error :-(
> > > write failed: Input/output error

350h is block 848.
Was your input file smaller than 2 MB ?


In general i wonder why this never showed up as a bug up to now.
It depends on the kernel whether this oversized parameter
of struct sg_io_hdr.dxfer_len can do harm. The actual transfer length can
be deduced from the SCSI command.

Well, if it fixes the problem without alignment, then it has something
to do with it.

Will this patch go into Fedora distro packages ?
If so, how to alert the others ?

growisofs needs an upstream maintainer until Andy Polyakov shows up again.
(I am competitor, but could well serve as review peer.)

-------------------------------------------------------------------------

I still suspect that the Sense Data came in "Descriptor" format from
the kernel.
One should probably test this augmented set of macros in transport.hxx

  #define ERRCODE_FIXED(s)      ((((s)[2]&0x0F)<<16)|((s)[12]<<8)|((s)[13]))
  #define ERRCODE_DESCR(s)      ((((s)[1]&0x0F)<<16)|((s)[2]<<8)|((s)[3]))
  #define ERRCODE(s)            ((s)[0] == 0x70 || (s)[0] == 0x71 ? \
                                  ERRCODE_FIXED(s) : \
                                 ((s)[0] == 0x72 || (s)[0] == 0x73 ? \
                                  ERRCODE_DESCR(s) : 0))

as replacement of

  #define ERRCODE(s)      ((((s)[2]&0x0F)<<16)|((s)[12]<<8)|((s)[13]))

E.g. whether it still properly reacts on missing media.

------------------------------------------------------------------------

> I think it's all right, if I understood what your meant by "readable size":
> $ isoinfo -d -dev=/dev/sr0 | grep 'Volume size'
> Volume size is: 138421

This is the ISO image size, as of the Primary Volume Descriptor in block 16
of the image.

I rather meant the readable size of the block device /dev/sr0.
Like with
  dd if=/dev/sr0 bs=2048 | wc -c
or
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <fcntl.h>
  #include <linux/fs.h>
  #include <stdio.h>
  int fd;
  long blocks;

  fd= open("/dev/sr0", O_RDONLY);
  ioctl(fd, BLKGETSIZE, &blocks); /* 512 byte blocks */
  printf("Readable 32 KiB chunks: %f\n", ((double) blocks) / 64.0); 


You may ask cdrskin to print a table-of-content from MMC commands:

  cdrskin dev=/dev/sr0 -minfo

which should yield something like
  Track  Sess Type   Start Addr End Addr   Size
  ==============================================
      1     1 Data   0          138420     138421    

Or ask dvd+rw-mediainfo (drive tray must be already loaded):
  
  dvd+rw-mediainfo /dev/sr0 | grep 'Track Size'

which should yield
   Track Size:            138421*2KB


> The above is valid for DVD burned with cdrskin-1.1.8-1.fc16.x86_64.

Seems that unaligned sessions by themselves are not to blame.

Well, i just finished enabling of 32 LiB alignment with DVD DAO
in cdrskin. Run-time option and compile time option.
So this retro feature will have to wait for a new reason to exist.


Have a nice day :)

Thomas


Reply to: