From 2651efc87ebbd25f12b245d2bb2717db27b4b152 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 3 Mar 2010 10:57:53 +0000 Subject: [PATCH] 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 --- scst/src/dev_handlers/scst_vdisk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 73a193ab5..70498c1f0 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -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)) {