[Pkg-opt-media-team] Bug#709971: dvd+rw-tools: growisofs more then 1 Bluray, since Debian 7 speed collapses

Thomas Schmitt scdbackup at gmx.net
Sun Jan 28 15:54:12 UTC 2018


Hi,

meanwhile the moment of breaking the kernel has been identified.
It was the mass removal of Big Kernel Lock in 2010 by Arnd Bergmann:
  https://lkml.org/lkml/2010/9/14/338

A summary of problem reports and investigations was posted to LKML in 2013
  https://marc.info/?l=linux-scsi&m=135705061804384&w=2
where one mutex per drive is proposed.

But actually ioctl(SG_IO) is rarely used by multiple users per drive.
So a lock per drive can hardly solve problems which might arise when the
common mutex for all drives gets removed.

So all or nothing:
I would just remove from function drivers/scsi/sr.c:sr_block_ioctl()
the lines
       mutex_lock(&sr_mutex);
and
       mutex_unlock(&sr_mutex);

With xorriso i use since two years /dev/sg rather than /dev/sr on a
vanilla kernel 3.16.
  https://dev.lovelyhq.com/libburnia/web/wikis/ConcurrentLinuxSr
sg did not have the Big Kernel Lock when the mass removal happened. So it
got no mutex and still works with normal performance on multiple drives.
Except the consequential poor coordination with "mount" and "eject"
there are no negative effects to see.

Regrettably the attempt to use /dev/sg with growisofs fails:

  $ growisofs -Z /dev/sg5=debian-8.8.0-amd64-netinst.iso
  Executing 'builtin_dd if=/dvdbuffer/debian-8.8.0-amd64-netinst.iso of=/dev/sg5 obs=32k seek=0'
  :-( write failed: Illegal seek
  $

growisofs uses POSIX i/o to read from the medium. This would have to be
changed to SCSI READ commands via ioctl(SG_IO) before /dev/sg would be
usable as drive address.


Have a nice day :)

Thomas



More information about the Pkg-opt-media-team mailing list