From f92d4bdfea5d0742eb4c0c4a572354801aab29d6 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 7 Dec 2007 17:32:33 +0000 Subject: [PATCH] Patch from Vu Pham : We currently have multiple scst targets with exported fileio or blockio luns using the same files or block devices. These fileio or blockio luns end up to have the same lun ID (dev_id_num), linux dm-multipath recognizes them as same lun (because of lun ID) with different paths which is wrong. It should be multiple separated luns from different scst targets. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@228 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 071db9a69..ef1109734 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -321,6 +321,12 @@ static char *vcdrom_proc_help_string = "echo \"open|change|close NAME [FILE_NAME]\" " ">/proc/scsi_tgt/" VCDROM_NAME "/" VCDROM_NAME "\n"; +static int scst_vdisk_ID; + +module_param_named(scst_vdisk_ID, scst_vdisk_ID, int, 0); +MODULE_PARM_DESC(scst_vdisk_ID, "SCST virtual disk subsystem ID"); + + /************************************************************** * Function: vdisk_open * @@ -1101,6 +1107,9 @@ static void vdisk_exec_inquiry(struct scst_cmd *cmd) */ dev_id_num ^= ((rv << i) | (rv >> (32 - i))); } + + dev_id_num += scst_vdisk_ID; + len = scnprintf(dev_id_str, 6, "%d", dev_id_num); TRACE_DBG("num %d, str <%s>, len %d", dev_id_num, dev_id_str, len);