This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 437362 - eject misidentifies removeable devices
eject misidentifies removeable devices
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: eject (Show other bugs)
8
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Zdenek Prikryl
Fedora Extras Quality Assurance
:
: 432187 437739 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-13 13:53 EDT by Jeremy Fitzhardinge
Modified: 2008-03-21 18:19 EDT (History)
4 users (show)

See Also:
Fixed In Version: 2.1.5-7.fc8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-03-21 18:15:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jeremy Fitzhardinge 2008-03-13 13:53:20 EDT
Description of problem:
eject on my ipod now fails, whereas it used to work:
: ezr:pts/20; eject /dev/sdb
eject: device "/dev/sdb" doesn't have a removable flag
exit status 1

Version-Release number of selected component (if applicable):
eject-2.1.5-6.fc8

How reproducible:
Always

Steps to Reproduce:
1.Plug in ipod
2.Note device
3.eject <device>
  
Actual results:
: ezr:pts/20; eject /dev/sdb
eject: device "/dev/sdb" doesn't have a removable flag
exit status 1

Expected results:
Successful eject.

Additional info:
Running strace on eject shows that its reading the removable flag for sda rather
than sdb:
...
12982 fstatat64(3, "sda", {st_mode=S_IFBLK|0640, st_rdev=makedev(8, 0), ...}, 0) = 0
12982 close(3)                          = 0
12982 open("/sys/block/sda/removable", O_RDONLY) = 3
12982 fstat64(3, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0
12982 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0xb7fc5000
12982 read(3, "0\n", 4096)              = 2
12982 close(3)                          = 0
...

$ cat /sys/block/sda/removable
0
$ cat /sys/block/sdb/removable
1
Comment 1 Jeremy Fitzhardinge 2008-03-13 13:54:42 EDT
This failure appeared in the latest update, which I just yum installed this morning.
Comment 2 Zdenek Prikryl 2008-03-13 14:17:40 EDT
Could you please send an output from

$ ls -la /dev/sd*
Comment 3 Jeremy Fitzhardinge 2008-03-13 14:41:23 EDT
brw-r----- 1 root disk 8,  0 2008-03-07 07:21 /dev/sda
brw-r----- 1 root disk 8,  1 2008-03-07 07:21 /dev/sda1
brw-r----- 1 root disk 8,  2 2008-03-07 07:21 /dev/sda2
brw-r----- 1 root disk 8,  3 2008-03-07 15:22 /dev/sda3
brw-r----- 1 root disk 8,  4 2008-03-07 07:21 /dev/sda4
brw-r----- 1 root disk 8,  5 2008-03-07 07:21 /dev/sda5
brw-r----- 1 root disk 8,  6 2008-03-07 07:21 /dev/sda6
brw-r----- 1 root disk 8, 16 2008-03-13 11:38 /dev/sdb
brw-r----- 1 root disk 8, 17 2008-03-13 11:38 /dev/sdb1
Comment 4 Jeremy Fitzhardinge 2008-03-13 15:07:09 EDT
Same happens with a normal USB stick, as you might expect.  If I plug in 2
external devices, so I have sd[abc], then "eject sdc" still looks at sda's
removable state.
Comment 5 Zdenek Prikryl 2008-03-13 15:17:13 EDT
Yes, I found the bug. Try to fix ASAP.
Comment 6 Eugene Savelov 2008-03-15 14:48:51 EDT
the same bug happens in fc7 update  - eject-2.1.5-6.fc7
Comment 7 Zdenek Prikryl 2008-03-16 05:47:50 EDT
*** Bug 432187 has been marked as a duplicate of this bug. ***
Comment 8 Zdenek Prikryl 2008-03-17 08:25:21 EDT
*** Bug 437739 has been marked as a duplicate of this bug. ***
Comment 9 Fedora Update System 2008-03-17 11:49:13 EDT
eject-2.1.5-7.fc8 has been submitted as an update for Fedora 8
Comment 10 Fedora Update System 2008-03-17 12:00:50 EDT
eject-2.1.5-7.fc7 has been submitted as an update for Fedora 7
Comment 11 Brian Miller 2008-03-18 18:04:35 EDT
eject-2.1.5-7.fc8 did not work. I still get the same error message. Rolling back
to 2.1.5-5 works fine.
Comment 12 BKJ 2008-03-18 19:58:09 EDT
works fine for me on fc8
Comment 13 Zdenek Prikryl 2008-03-19 04:20:18 EDT
(In reply to comment #11)
> eject-2.1.5-7.fc8 did not work. I still get the same error message. Rolling back
> to 2.1.5-5 works fine.

Could you post here what are you trying to eject, $ ls -la /dev/<device>, $ ls
-la /sys/block/ and $ cat /sys/block/<device>/removable?

Thanks
Comment 14 Christian Krause 2008-03-19 15:20:08 EDT
I've tested the new build and it works fine. Strac'ing it verifies that now the
"removable" flag of the correct interface is checked (and not always sda).
Comment 15 Fedora Update System 2008-03-21 18:15:34 EDT
eject-2.1.5-7.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 16 Fedora Update System 2008-03-21 18:19:10 EDT
eject-2.1.5-7.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

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