Ticket #78 (new task)

Opened 2 years ago

Last modified 2 years ago

Protect dvd+rw-tools and libburn from spoiling each other on kernel 2.4

Reported by: scdbackup Owned by: scdbackup
Priority: major Milestone: 0.3.2
Component: libburn Version:
Keywords: growisofs dvd+rw-tools locking Cc:

Description (last modified by scdbackup) (diff)

Protect dvd+rw-tools and libburn from spoiling each other on kernel 2.4

The problem on my system is as follows:

- growisofs burns of DVD+RW experience data damage in about 25 % of the cases after libburn did a bus scan on the burning drive. The problem is eventually located within a single 64 kB data block. I detect it with an own 64k block checksummer.

- growisofs burns of DVD-RW stall libburn bus scan as soon as the active drive is enumerated. This might be a peculiarity of SuSE 9.0. Affected growisofs burns have about 50 % probability to be damaged and in this case, the checksummer experiences early EOF within the last 500 MB of a 4.7e9 bytes test image.

Both effects stem from the fact that growisofs locks /dev/srN but libburn uses /dev/sgN . It turned out that /dev/srN on my SuSE 9.0 are incapable of doing proper O_EXCL locking, anyway.

O_EXCL locking seems to work fine on /dev/hd? with kernel 2.6, and on /dev/sg* with kernel 2.4.>=21 .

Thus i see no way to detect a growisofs run on a burner of my system without making changes in growisofs. Recently i asked for cooperation in http://lists.debian.org/cdwrite/2006/09/msg00089.html but Andy Polyakov, the author of growisofs, did not reply yet.

I explored the possibilities within growisofs on my own and implemented two approaches:

A portable, quite neatly designed lockfile system, which has the one disadvantage to depend on the locking process to remove that lock actively. This seems not to fit well with growisofs for now. I see few chance to talk Andy into the necessary global changes for only us Linux 2.4 ide-scsi users. (We are not so few, though.)

What i ask you all to test now, is an extension of the existing Linux specific locking within growisofs 7.0 . This extension is triggered by ioctl_device content /dev/sr[0-9]* and /dev/scd[0-9]* and tries to lock the corresponding /dev/sg* . It consists of about 150 lines of new code.

If tests on various Linux systems show no other effects than righteous lock collisions between growisofs and cdrskin, then i hope to get Andy into accepting my patch or into implementing its functionality via his own code.

For that i need the help of growisofs users:

--- Test topics:

First i am interested in confirmation that everything works as with original growisofs 7.0 on any Linux system. Especially on kernel 2.6 with /dev/hdX there should be no change.

Second i am interested in reports about deliberate collisions of growisofs and cdrskin. Does "cdrskin -scanbus" stall ? Does growisofs abort properly if cdrskin is using the drive ? (Try: "cdrskin -v -v dev=/dev/... grab_drive_and_wait=300" with a writeable DVD+-RW media loaded.)

Users of pseudo-SCSI systems: Be aware that only growisofs does this locking for now, not the other dvd+rw-tools. Also be aware that this locking happens quite late - but still before the burn begins. So expect cdrskin stalling if both programs start at nearly the same time until growisofs notices that it is too late on /dev/sg.

--- Test equipment:

- Download http://scdbackup.sourceforge.net/dvd+rw-tools-7.0.tsA60930.tar.gz

Changes only affected file growisofs.c . If interesed, see: http://scdbackup.sourceforge.net/dvd+rw-tools-7.0.tsA60930.diff.txt

- Unpack in a directory of your choice: tar xzf dvd+rw-tools-7.0.tsA60930.tar.gz

- Compile: cd dvd+rw-tools-7.0.tsA60930 ; make

- Copy the emerged binary "growisofs" over your local binary and do your usual growisofs things. If you are not user of growisofs yet, learn about it, install it and enjoy its benefits with DVD recordings of all kinds.

- Original growisofs 7.0 is available as http://fy.chalmers.se/~appro/linux/DVD+RW/tools/dvd+rw-tools-7.0.tar.gz

- cdrskin is available as http://scdbackup.sourceforge.net/cdrskin-0.2.3.tar.gz http://scdbackup.sourceforge.net/cdrskin_0.2.3-x86-suse9_0-static.tar.gz see http://scdbackup.sourceforge.net/README_cdrskin_devel

--- Where to report:

Please attach reports to this page

http://libburn.pykix.org/ticket/78

or mail in public to

libburn-hackers@…

or in private to

scdbackup@…

Attachments

dvd+rw-tools-7.0.tsA60930.diff (5.3 kB) - added by scdbackup 2 years ago.
The changes in growisofs 7.0.tsA60930 towards original 7.0

Change History

Changed 2 years ago by scdbackup

The changes in growisofs 7.0.tsA60930 towards original 7.0

Changed 2 years ago by scdbackup

  • description modified (diff)

Changed 2 years ago by scdbackup

Andy Polyakov meanwhile replied

http://lists.debian.org/cdwrite/2006/cdwrite/2006/10/msg00022.html

http://lists.debian.org/cdwrite/2006/cdwrite/2006/10/msg00035.html

and there is hope that the next version of growisofs will somwhow lock /dev/sgN if appropriate.

Changed 2 years ago by pygi

  • milestone changed from 0.2.6 to 0.3.1
Note: See TracTickets for help on using tickets.