[PATCH] fix blockdev --getro for sr, sd, ide-floppy devs
From: John McKell
Date: Tue Jan 20 2004 - 17:18:48 EST
This 2.6.1 patch works by setting gendisk->policy to the correct value
during initialization as the various drivers decide whether or not the
disk is writeable. This patch persuades "blockdev --getro ..." to
correctly report the read-only state of a newly inserted disk. This
patch applies to sr.c, sd.c and ide-floppy.c. ide-cd.c already has
this functionality built into it.
Using an Iomega Zip drive as the test case...
Without the patch, I always see:
$ sudo blockdev --getro /dev/sda
0
$
That's only correct for writeable disks though. Only when the patch
is applied do I see a write-protected disk described correctly:
$ sudo blockdev --getro /dev/sda
1
$
--John McKell
-
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/