BLKFLSBUF on ramdisks

From: Todd Poynor
Date: Wed May 26 2004 - 21:07:57 EST


The BLKFLSBUF ioctl has a different meaning on ramdisks than on other
block devices: the memory for the ramdisk is freed (whereas cached
blocks are flushed to the device for most other devices, which obviously
would be a NOP for ramdisks). At least one command, freeramdisk of
BusyBox, expects this behavior. If certain other commands that issue
BLKFLSBUF are inadvertently run on a ramdisk device (as in a script that
previously tested fine on other devices) then the filesystem is
basically corrupted instead of the normally expected result. For
example, badblocks or e2fsck -F.

While this can be initially alarming, it is easily figured out and
avoided in the future (no one really needs to check bad blocks or
filesystem integrity on a ramdisk, and I'd assume other uses of the
ioctl would fall into a similar category). The two incompatible
definitions of the ioctl do seem unfortunate, however, and I figured I'd
ask here in case there's any interest in changing this situation; if so,
I will gladly help, thanks,

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