mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 03:01:26 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user