If a device set read-only in a security group, it should also be reported in MODE...
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Wed, 3 Mar 2010 10:57:53 +0000 (10:57 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Wed, 3 Mar 2010 10:57:53 +0000 (10:57 +0000)
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@1530 d57e44dd-8a1f-0410-8b47-8ef2f437770f

scst/src/dev_handlers/scst_vdisk.c

index 73a193a..70498c1 100644 (file)
@@ -1777,7 +1777,8 @@ static void vdisk_exec_mode_sense(struct scst_cmd *cmd)
        pcode = cmd->cdb[2] & 0x3f;
        subpcode = cmd->cdb[3];
        msense_6 = (MODE_SENSE == cmd->cdb[0]);
-       dev_spec = (virt_dev->dev->rd_only ? WP : 0) | DPOFUA;
+       dev_spec = ((virt_dev->dev->rd_only ||
+                    cmd->tgt_dev->acg_dev->rd_only) ? WP : 0) | DPOFUA;
 
        length = scst_get_buf_first(cmd, &address);
        if (unlikely(length <= 0)) {