|Summary:||Attempt to mount floppy fails with mount: /dev/fd0 is not a valid block device|
|Product:||IO/Storage||Reporter:||Alex Villacis Lasso (avillaci)|
|Component:||Block Layer||Assignee:||Jens Axboe (axboe)|
|Severity:||normal||CC:||florian, maciej.rutecki, rjw, tj|
|Bug Depends on:|
Description Alex Villacis Lasso 2011-05-25 15:30:56 UTC
Up to and including 2.6.39-rc7, the root user can mount a floppy in a standard PC floppy drive by issuing "mount /dev/fd0 /mnt/floppy". An ordinary user cannot do this (even with a fstab mount entry) due to bug #28522. Starting with 2.6.39, if root tries to do the same operation, this is the output: [root@karlalex ~]# mount /dev/fd0 /mnt/floppy/ mount: /dev/fd0 is not a valid block device No I/O is ever attempted on the floppy drive. To reproduce: 1) Boot 2.6.39 in x86_64 machine with a standard floppy drive (not USB, not parport) and no floppy inserted in the drive. 2) After boot finishes, insert floppy in drive 3) Attempt (as root) to mount the floppy. Actual results: mount: /dev/fd0 is not a valid block device No I/O attempted on drive. Expected results: Mount should be successful, or at least I/O should be attempted on the drive. Any attempt to access /dev/fd0 (such as dd) is affected in the same way. A strace on mount shows that the open() operation on /dev/fd0 fails with ENXIO, as well as the actual mount() operation. Bisection on this bug points to the following commit: commit 9fd097b14918875bd6f125ed699d7bbbba5893ee Author: Tejun Heo <firstname.lastname@example.org> Date: Thu Apr 21 21:32:55 2011 +0200 block: unexport DISK_EVENT_MEDIA_CHANGE for legacy/fringe drivers In-kernel disk event polling doesn't matter for legacy/fringe drivers and may lead to infinite event loop if ->check_events() implementation generates events on level condition instead of edge. Now that block layer supports suppressing exporting unlisted events, simply leaving disk->events cleared allows these drivers to keep the internal revalidation behavior intact while avoiding weird interactions with userland event handler. Signed-off-by: Tejun Heo <email@example.com> Cc: Kay Sievers <firstname.lastname@example.org> Signed-off-by: Jens Axboe <email@example.com> Reverting this particular commit fixes the bug for me.
Comment 1 Tejun Heo 2011-05-25 20:52:40 UTC
Created attachment 59462 [details] dont-check-events-on-disk_add_events.patch Can you please test this patch? Thanks.
Comment 2 Rafael J. Wysocki 2011-05-25 21:04:22 UTC
First-Bad-Commit : 9fd097b14918875bd6f125ed699d7bbbba5893ee
Comment 3 Alex Villacis Lasso 2011-05-26 15:16:32 UTC
The patch dont-check-events-on-disk_add_events.patch indeed fixes the bug.
Comment 4 Alex Villacis Lasso 2011-06-01 17:07:08 UTC
There is now a serious problem when mounting /dev/fd0u1440 in 3.0.0-rc1, described at bug #28522.
Comment 5 Florian Mickler 2011-06-07 08:01:01 UTC