public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Weirdness of "mount -o remount,rw" with write-protected floppy
@ 2005-10-27 11:57 Evgeny Stambulchik
  2005-10-27 15:05 ` Jon Masters
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Evgeny Stambulchik @ 2005-10-27 11:57 UTC (permalink / raw)
  To: linux-kernel

Hello,

here is what I found the hard way (having lost the configuration of a 
firewall...):

# mount /dev/fd0 /mnt/floppy/
mount: block device /dev/fd0 is write-protected, mounting read-only
# mount -o remount,rw /mnt/floppy
# echo $?
0
# touch /mnt/floppy/blabla
# ls -l  /mnt/floppy/blabla
-rwxr-xr-x  1 root root 0 Oct 27 13:18 /mnt/floppy/blabla*
# umount /mnt/floppy
# echo $?
0
# mount /dev/fd0 /mnt/floppy/
mount: block device /dev/fd0 is write-protected, mounting read-only
# ls -l  /mnt/floppy/blabla
ls: /mnt/floppy/blabla: No such file or directory

The kernel actually tries to write to the floppy - the light is blinking 
(so everything looks nice from outside). Of course, there are kernel 
errors, seen in dmesg like:

 > end_request: I/O error, dev fd0, sector 21
 > Buffer I/O error on device fd0, logical block 21
 > lost page write due to I/O error on fd0

but these don't propagate to the user space in any way.

The bug is present in both 2.4 and 2.6, and is specific to floppy 
devices. Other RO media I tried (CDROM, RO-exported NFS) are partially 
OK, in the sense that a write attempt returns an error; however, "mount 
-o remount,rw" always returns success (this might be a bug in mount).

Regards,

Evgeny

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-10-29 17:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-27 11:57 Weirdness of "mount -o remount,rw" with write-protected floppy Evgeny Stambulchik
2005-10-27 15:05 ` Jon Masters
2005-10-29 11:58   ` Jon Masters
2005-10-29 13:10     ` Jon Masters
2005-10-27 21:09 ` Rob Landley
2005-10-28 11:55   ` Evgeny Stambulchik
2005-10-28 12:26     ` Rob Landley
2005-10-28 13:15       ` Evgeny Stambulchik
2005-10-28 13:50         ` Rob Landley
2005-10-28 14:52           ` Evgeny Stambulchik
2005-10-29  1:29             ` Rob Landley
2005-10-29 11:06               ` Evgeny Stambulchik
2005-10-29 16:02 ` Jon Masters
2005-10-29 17:05   ` Jon Masters

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox