From 33bd34813ae9f8ac907b4e9737179fce2cb2bc9b Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Sat, 25 Sep 2010 18:42:32 +0000 Subject: [PATCH] Merge of the trunk's 2274: Remove checking of rel_tgt_id on disabling targets git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.0.0.x@2276 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_sysfs.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index a9d0ba2ca..eb9facb32 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -1006,19 +1006,21 @@ static int scst_process_tgt_enable_store(struct scst_tgt *tgt, bool enable) TRACE_DBG("tgt %s, enable %d", tgt->tgt_name, enable); - if (enable && (tgt->rel_tgt_id == 0)) { - res = gen_relative_target_port_id(&tgt->rel_tgt_id); - if (res != 0) - goto out_put; - PRINT_INFO("Using autogenerated rel ID %d for target " - "%s", tgt->rel_tgt_id, tgt->tgt_name); - } else { - if (!scst_is_relative_target_port_id_unique( - tgt->rel_tgt_id, tgt)) { - PRINT_ERROR("Relative port id %d is not unique", - tgt->rel_tgt_id); - res = -EBADSLT; - goto out_put; + if (enable) { + if (tgt->rel_tgt_id == 0) { + res = gen_relative_target_port_id(&tgt->rel_tgt_id); + if (res != 0) + goto out_put; + PRINT_INFO("Using autogenerated rel ID %d for target " + "%s", tgt->rel_tgt_id, tgt->tgt_name); + } else { + if (!scst_is_relative_target_port_id_unique( + tgt->rel_tgt_id, tgt)) { + PRINT_ERROR("Relative port id %d is not unique", + tgt->rel_tgt_id); + res = -EBADSLT; + goto out_put; + } } }