lkml.org 
[lkml]   [2004]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Subject[PATCH] fix blockdev --getro for sr, sd, ide-floppy devs
From
Date
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.063 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site