Re: [PATCH] MMC block removable flag

From: Russell King
Date: Sat Jan 08 2005 - 06:18:24 EST


On Fri, Jan 07, 2005 at 03:00:35PM +0100, Andries Brouwer wrote:
> On Fri, Jan 07, 2005 at 12:39:47PM +0000, Russell King wrote:
> > Can anyone comment on the purpose of this (GENHD_FL_REMOVABLE) flag?
> > Al? Jens?
>
> GENHD_FL_REMOVABLE is set by a number of drivers (floppy, CDROM, ...).
> It is used in two places:
> (1) to fill the file /sys/block/*/removable
> (2) in genhd to suppress listing a nonpartitioned removable device
> in /proc/partitions.
>
> In other words, it is for user space only, precisely as Pierre Ossman said.

Your point 2 isn't user space though.

Also, it's buggy. Consider a SCSI PCMCIA card with SCSI disks attached.
When you eject that card, your SCSI disks disappear, yet they aren't
marked as removable. If user space is relying on /sys/block/*/removable
to tell it if things may go away, then user space is buggy.

Maybe it's for devices which may be present (eg, floppy driver), but
which have removable media (eg, floppy disk), rather than removable
devices?

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
-
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/