Bug 128249

Summary: cdrecord should use O_EXCL
Product: [Fedora] Fedora Reporter: David Zeuthen <david>
Component: cdrtoolsAssignee: Harald Hoyer <harald>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: bnocera, notting
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-22 11:59:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 123268    

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