read only scsi disk

Ming Zhang
2006-02-09T17:04:23Z

Hi folks

Could anybody shed a light on this?

We are adding the support for an OSS iscsi target to support export an
iscsi disk as readonly. We set correct read only bit in sense dbd. But
we found that only when we set the removable bit, the linux will
actually check the ro bit. more detail information can be found from

http://sourceforge.net/mailarchive/forum.php?thread_id=9682261&forum_id=40837

from sd.c, it looks like removable is judged first.

if (sdp->removable)
sd_read_write_protect_flag(sdkp, disk->disk_name,
buffer);

so is there special reason that we should judge removable before we see
if write protect?

thanks!

Ming