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
This commit is contained in:
Vladislav Bolkhovitin
2010-09-25 18:42:32 +00:00
parent 56ae926937
commit 33bd34813a

View File

@@ -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;
}
}
}