Bug 128249 - cdrecord should use O_EXCL
Summary: cdrecord should use O_EXCL
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: cdrtools
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact:
URL:
Whiteboard:
: 132756 (view as bug list)
Depends On:
Blocks: FC3Target
TreeView+ depends on / blocked
 
Reported: 2004-07-20 20:21 UTC by David Zeuthen
Modified: 2007-11-30 22:10 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-09-22 11:59:38 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description David Zeuthen 2004-07-20 20:21:03 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7)
Gecko/20040706 Firefox/0.9.1

Description of problem:
cdrecord doesn't open the CD device with O_EXCL. This is bad since
O_EXCL is used to lock other disc media detection programs that poll
for media out. Such as magicdev or hal.

My impression is that on some drives this doesn't matter but on a
select few it does result in bad burns. 

O_EXCL is in mainline 2.6.


Version-Release number of selected component (if applicable):
cdrecord-2.01.0.a33-1

How reproducible:
Always

Steps to Reproduce:
[david@ixus david]$ strace cdrecord -v speed=2 dev=/dev/hdc
FC2-test1-i386-disc4.iso > cdout 2>&1
[david@ixus david]$ cat cdout |grep "open(\"/dev/hdc"
open("/dev/hdc", O_RDWR|O_NONBLOCK)     = 3


Actual Results:  I burned a CD and using strace I saw that the device
was opened with O_EXCL

Expected Results:  cdrecord should open the device
O_RDRW|O_NONBLOCK|O_EXCL instead.

Additional info:

Comment 1 Bastien Nocera 2004-07-20 22:30:35 UTC
It had the patch modified in version 8:2.0-8, but there's no mention
of it being removed in subsequent versions.

Comment 2 Harald Hoyer 2004-09-03 10:23:50 UTC
this patch is really hard to do with all the new device layers...
cdrecord opens _ALL_ cdroms for its pseudo scsi-bus-mapping and then
uses the fd for the appropriate device...

I patched growisofs to do the right thing... but cdrecord needs more
hours of thinking this through :-/

Comment 3 Harald Hoyer 2004-09-16 18:54:17 UTC
*** Bug 132756 has been marked as a duplicate of this bug. ***

Comment 4 Harald Hoyer 2004-09-22 11:59:38 UTC
done for the case where you directly specify the device per devnode.
e.g. dev=/dev/cdrom


Note You need to log in before you can comment on or make changes to this bug.