Re: write access to read-only mounted device, uhh

Matthew Geier (matthew@janus.law.usyd.edu.au)
Sun, 10 Jan 1999 09:55:01 +1100 (EST)


> When trying to hunt a bug in dmsdos, I ran into a problem with the FAT
> driver. Well, meanwhile I think this is not a problem of the FAT driver,
> but may be a more general problem, probably affecting other filesystems,
> too. It seems, that under some circumstances, the FAT driver or something
> at a higher level (probably VFS) can write to a device though it is mounted
> read-only.
>
This might explain how I managed to corrupt the FAT file system on
compact fash card.
I use a Laptop running RH 5.2 linux to read the flash cards from my
camera. I have a 16meg card and a 4 Meg card. I mount the flash cards
read only, I delete the picture files back on the camera.

Well recently I ejected the 16meg card and inserted the 4meg card
with out umounting the device first. The system got a little upset
when I tried to list the directory, with all sorts of errors. Then
I realised my error and removed the card and umounted the file
system. However the 4 meg card's FAT file system was rather worse
for wear afterward, and I lost several unsaved photos as a result.
I for one was rather confused how a 'disk' mounted read only appeared
to be modified by the system.
(The flash cards emulate an ATA harddisk - Linux/PCMCIA Card Services
treat them like hard disks...)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/