Bug 684160

Summary: ejected dvd disk reinserts itself after ejection (dolphin, 'eject' command)
Product: [Fedora] Fedora Reporter: Reartes Guillermo <rtguille>
Component: udisksAssignee: Tomáš Bžatek <tbzatek>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 17CC: bughunt, dwysocha, mclasen, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-01 11:28:08 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:

Description Reartes Guillermo 2011-03-11 11:02:43 UTC
Description of problem: Sometimes, when ejecting a dvd from dolphin, command line, the dvd reinserts itself inmediatelly. Sometimes it just ejects normally.



Version-Release number of selected component (if applicable):


How reproducible:
easy, but does not allways happen

Steps to Reproduce:

* Insert a data dvd-r (already writen)
From Konsole (without any mount command) issue the eject command.
The dvd ejects normally.

* Insert a data dvd-r (already writen)
Mount it from dolphin, eject it from dolphin.
The dvd ejects and inmediatelly reinserts.
Press dvd's eject button, the drive ejects normally.

* Insert a data dvd-r (already writen)
Mount it from dolphin, eject from dolphin, 'device mounted' a couple of tries.
df shows it is not mounted.
Eventually the disc ejects and then reinserts itselft.
Issue eject command from Konsole, the disc ejects and reinserts itself again.
Press dvd's eject button, the disk ejects normally.


  
Actual results: the disc is ejected and inmediately reinserted.

Expected results: the disc is ejected.


Additional info:

Example of the issue (when ejected from dolphin):

# udisks --monitor-detail
Monitoring activity from the disks daemon. Press Ctrl+C to cancel.
changed:     /org/freedesktop/UDisks/devices/sr0
Showing information for /org/freedesktop/UDisks/devices/sr0
  native-path:                 /sys/devices/pci0000:00/0000:00:09.0/host3/target3:0:0/3:0:0:0/block/sr0
  device:                      11:0
  device-file:                 /dev/sr0
    presentation:              /dev/sr0
    by-id:                     /dev/disk/by-id/ata-ASUS_DRW-20B1LT
    by-path:                   /dev/disk/by-path/pci-0000:00:09.0-scsi-3:0:0:0
  detected at:                 Fri 11 Mar 2011 07:16:23 AM ART
  system internal:             0
  removable:                   1
  has media:                   0
    detects change:            1
    detection by polling:      1
    detection inhibitable:     1
    detection inhibited:       0
  is read only:                0
  is mounted:                  0
  mount paths:             
  mounted by uid:              0
  presentation hide:           0
  presentation nopolicy:       0
  presentation name:           
  presentation icon:           
  size:                        0
  block size:                  0
  job underway:                no
  usage:                       
  type:                        
  version:                     
  uuid:                        
  label:                       
  drive:
    vendor:                    ASUS
    model:                     ASUS    DRW-20B1LT
    revision:                  1.01
    serial:                    
    WWN:                       
    detachable:                0
    can spindown:              0
    rotational media:          Yes, unknown rate
    write-cache:               unknown
    ejectable:                 1
    adapter:                   /org/freedesktop/UDisks/adapters/0000_3a00_3a09_2e0
    ports:
      /org/freedesktop/UDisks/adapters/0000_3a00_3a09_2e0/host3
    similar devices:
    media:                     
      compat:                  optical_cd optical_cd_r optical_cd_rw optical_dvd optical_dvd_r optical_dvd_ram
    interface:                 scsi
    if speed:                  (unknown)
    ATA SMART:                 not available

changed:     /org/freedesktop/UDisks/devices/sr0
Showing information for /org/freedesktop/UDisks/devices/sr0
  native-path:                 /sys/devices/pci0000:00/0000:00:09.0/host3/target3:0:0/3:0:0:0/block/sr0
  device:                      11:0
  device-file:                 /dev/sr0
    presentation:              /dev/sr0
    by-id:                     /dev/disk/by-id/ata-ASUS_DRW-20B1LT
    by-path:                   /dev/disk/by-path/pci-0000:00:09.0-scsi-3:0:0:0
  detected at:                 Fri 11 Mar 2011 07:16:23 AM ART
  system internal:             0
  removable:                   1
  has media:                   1 (detected at Fri 11 Mar 2011 07:53:42 AM ART)
    detects change:            1
    detection by polling:      1
    detection inhibitable:     1
    detection inhibited:       0
  is read only:                0
  is mounted:                  0
  mount paths:             
  mounted by uid:              0
  presentation hide:           0
  presentation nopolicy:       0
  presentation name:           
  presentation icon:           
  size:                        4318560256
  block size:                  2048
  job underway:                no
  usage:                       filesystem
  type:                        iso9660
  version:                     
  uuid:                        
  label:                       SlackDVD
  optical disc:
    blank:                     0
    appendable:                1
    closed:                    0
    num tracks:                2
    num audio tracks:          0
    num sessions:              2
  drive:
    vendor:                    ASUS
    model:                     ASUS    DRW-20B1LT
    revision:                  1.01
    serial:                    
    WWN:                       
    detachable:                0
    can spindown:              0
    rotational media:          Yes, unknown rate
    write-cache:               unknown
    ejectable:                 1
    adapter:                   /org/freedesktop/UDisks/adapters/0000_3a00_3a09_2e0
    ports:
      /org/freedesktop/UDisks/adapters/0000_3a00_3a09_2e0/host3
    similar devices:
    media:                     optical_dvd_plus_r
      compat:                  optical_cd optical_cd_r optical_cd_rw optical_dvd optical_dvd_plus_r optical_dvd_plus_r_dl optical_dvd_plus_rw optical_dvd_r optical_dvd_ram optical_dvd_rw
    interface:                 scsi
    if speed:                  (unknown)
    ATA SMART:                 not available

job-changed: /org/freedesktop/UDisks/devices/sr0
  job underway:                DriveEject, initiated by uid 500
job-changed: /org/freedesktop/UDisks/devices/sr0
  job underway:                no
changed:     /org/freedesktop/UDisks/devices/sr0
Showing information for /org/freedesktop/UDisks/devices/sr0
  native-path:                 /sys/devices/pci0000:00/0000:00:09.0/host3/target3:0:0/3:0:0:0/block/sr0
  device:                      11:0
  device-file:                 /dev/sr0
    presentation:              /dev/sr0
    by-id:                     /dev/disk/by-id/ata-ASUS_DRW-20B1LT
    by-path:                   /dev/disk/by-path/pci-0000:00:09.0-scsi-3:0:0:0
  detected at:                 Fri 11 Mar 2011 07:16:23 AM ART
  system internal:             0
  removable:                   1
  has media:                   1 (detected at Fri 11 Mar 2011 07:53:42 AM ART)
    detects change:            1
    detection by polling:      1
    detection inhibitable:     1
    detection inhibited:       0
  is read only:                0
  is mounted:                  0
  mount paths:             
  mounted by uid:              0
  presentation hide:           0
  presentation nopolicy:       0
  presentation name:           
  presentation icon:           
  size:                        4318560256
  block size:                  2048
  job underway:                no
  usage:                       filesystem
  type:                        iso9660
  version:                     
  uuid:                        
  label:                       SlackDVD
  optical disc:
    blank:                     0
    appendable:                1
    closed:                    0
    num tracks:                2
    num audio tracks:          0
    num sessions:              2
  drive:
    vendor:                    ASUS
    model:                     ASUS    DRW-20B1LT
    revision:                  1.01
    serial:                    
    WWN:                       
    detachable:                0
    can spindown:              0
    rotational media:          Yes, unknown rate
    write-cache:               unknown
    ejectable:                 1
    adapter:                   /org/freedesktop/UDisks/adapters/0000_3a00_3a09_2e0
    ports:
      /org/freedesktop/UDisks/adapters/0000_3a00_3a09_2e0/host3
    similar devices:
    media:                     optical_dvd_plus_r
      compat:                  optical_cd optical_cd_r optical_cd_rw optical_dvd optical_dvd_plus_r optical_dvd_plus_r_dl optical_dvd_plus_rw optical_dvd_r optical_dvd_ram optical_dvd_rw
    interface:                 scsi
    if speed:                  (unknown)
    ATA SMART:                 not available

Comment 1 Reartes Guillermo 2011-05-07 15:42:54 UTC
I have opened a bug-report to upstream some time ago: 

Bug 269146 - F15 ejecting a cd/dvd disk with dolphin causes it to reinsert itself right after ejection (works ok when no dolphin instances are running)
 https://bugs.kde.org/show_bug.cgi?id=269146

There, a user pointed to udev or kernel:
 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/356631/comments/32

BEFORE/DEFAULT:
# probe filesystem metadata of optical drives which have a media inserted
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"

NEW:
# from https://bugs.launchpad.net/ubuntu/+source/linux/+bug/356631/comments/32
KERNEL=="sr*", ENV{ID_CDROM_MEDIA_STATE}=="blank", GOTO="persistent_storage_end"
# probe filesystem metadata of optical drives which have a media inserted
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"

I still have the problem, with data cds/dvds.

libgudev1.x86_64     167-4.fc15            @fedora                     
libudev.x86_64       167-4.fc15            @fedora                     
udev.x86_64          167-4.fc15            @fedora
kernel               2.6.38.5-22.fc15.x86_64

Comment 2 Reartes Guillermo 2011-07-14 19:28:21 UTC
The solution  posted in: 

> I have opened a bug-report to upstream some time ago: 
> 
> Bug 269146 - F15 ejecting a cd/dvd disk with dolphin causes it to reinsert
> itself right after ejection (works ok when no dolphin instances are running)
>  https://bugs.kde.org/show_bug.cgi?id=269146

works for me, i have used since a while. It is needed both on the desktop (the reported affected system and any laptop i encountered (for example a DELL e4310).

# sysctl -a| grep dev.cdrom.autoclose
dev.cdrom.autoclose = 1

# sysctl -w dev.cdrom.autoclose=0
dev.cdrom.autoclose = 0

---

Can the default be changed for new installs / updates ?

Comment 3 Reartes Guillermo 2012-07-21 14:35:00 UTC
Changed version to 17 since it is still present in F17.

Comment 4 David Tonhofer 2012-08-22 21:19:02 UTC
Indeed. Confirming problem in Fedora 17 with Dolphin. 

If one is fast as a striking snake, one stands a chance against the machine...

Comment 5 Fedora Admin XMLRPC Client 2013-02-04 13:43:50 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 6 Fedora End Of Life 2013-07-04 03:37:12 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Fedora End Of Life 2013-08-01 11:28:14 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.