If a device set read-only in a security group, it should also be reported in MODE SENSE

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1530 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2010-03-03 10:57:53 +00:00
parent 85aa95c415
commit 2651efc87e

View 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)) {