From 12ba32186b5b3b1bc5a45de96f275567a4cd73ab Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 8 Oct 2015 00:13:00 +0000 Subject: [PATCH] scst: Allow replace a LUN without generating INQUIRY DATA HAS CHANGED (for failover) git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6534 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_sysfs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index 59bd2112b..7a4a033d7 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -1268,6 +1268,7 @@ static int __scst_process_luns_mgmt_store(char *buffer, SCST_LUN_ACTION_REPLACE = 3, SCST_LUN_ACTION_CLEAR = 4, }; + bool replace_gen_ua = true; TRACE_ENTRY(); @@ -1281,6 +1282,10 @@ static int __scst_process_luns_mgmt_store(char *buffer, action = SCST_LUN_ACTION_DEL; } else if (strcasecmp("replace", p) == 0) { action = SCST_LUN_ACTION_REPLACE; + replace_gen_ua = true; + } else if (strcasecmp("replace_no_ua", p) == 0) { + action = SCST_LUN_ACTION_REPLACE; + replace_gen_ua = false; } else if (strcasecmp("clear", p) == 0) { action = SCST_LUN_ACTION_CLEAR; } else { @@ -1424,7 +1429,7 @@ static int __scst_process_luns_mgmt_store(char *buffer, if (res != 0) goto out_unlock; - if (dev_replaced) { + if (dev_replaced && replace_gen_ua) { struct scst_tgt_dev *tgt_dev; list_for_each_entry(tgt_dev, &dev->dev_tgt_dev_list, @@ -1556,6 +1561,8 @@ static ssize_t scst_luns_mgmt_show(struct kobject *kobj, " echo \"del lun\" >mgmt\n" " echo \"replace H:C:I:L lun [parameters]\" >mgmt\n" " echo \"replace VNAME lun [parameters]\" >mgmt\n" + " echo \"replace_no_ua H:C:I:L lun [parameters]\" >mgmt\n" + " echo \"replace_no_ua VNAME lun [parameters]\" >mgmt\n" " echo \"clear\" >mgmt\n" "\n" "where parameters are one or more "