summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortim szeto <Tim.Szeto@Sun.COM>2009-11-19 11:03:38 -0700
committertim szeto <Tim.Szeto@Sun.COM>2009-11-19 11:03:38 -0700
commitf80ea9bbe1103fdcfafa9f1b139df1e2f42ad5c1 (patch)
treeed792ea7035f50321b508a6b72394e426d4cc7e8
parentaf40a12383722896f102f17fd227ed8a0de0bd15 (diff)
downloadillumos-gate-f80ea9bbe1103fdcfafa9f1b139df1e2f42ad5c1.tar.gz
6896419 FC: panic when destroying LUN (assertion failed: lun_map_ent && lun_map_ent->ent_lu == lu, ...)
-rw-r--r--usr/src/cmd/stmfadm/stmfadm.c5
-rw-r--r--usr/src/uts/common/io/comstar/stmf/lun_map.c10
2 files changed, 15 insertions, 0 deletions
diff --git a/usr/src/cmd/stmfadm/stmfadm.c b/usr/src/cmd/stmfadm/stmfadm.c
index 92e21c8f59..045edfb50b 100644
--- a/usr/src/cmd/stmfadm/stmfadm.c
+++ b/usr/src/cmd/stmfadm/stmfadm.c
@@ -411,6 +411,11 @@ addTargetGroupMemberFunc(int operandLen, char *operands[],
gettext("STMF service version incorrect"));
ret++;
break;
+ case STMF_ERROR_TG_ONLINE:
+ (void) fprintf(stderr, "%s: %s\n", cmdName,
+ gettext("STMF target must be offline"));
+ ret++;
+ break;
default:
(void) fprintf(stderr, "%s: %s: %s\n", cmdName,
operands[i], gettext("unknown error"));
diff --git a/usr/src/uts/common/io/comstar/stmf/lun_map.c b/usr/src/uts/common/io/comstar/stmf/lun_map.c
index b89b52c966..824be9a565 100644
--- a/usr/src/uts/common/io/comstar/stmf/lun_map.c
+++ b/usr/src/uts/common/io/comstar/stmf/lun_map.c
@@ -1458,6 +1458,16 @@ stmf_add_group_member(uint8_t *grpname, uint16_t grpname_size,
else
return (0);
}
+
+ /* verify target is offline */
+ if (entry_type == STMF_ID_TYPE_TARGET) {
+ ilport = stmf_targetident_to_ilport(entry_ident, entry_size);
+ if (ilport && ilport->ilport_state != STMF_STATE_OFFLINE) {
+ *err_detail = STMF_IOCERR_TG_NEED_TG_OFFLINE;
+ return (EBUSY);
+ }
+ }
+
id_member = stmf_alloc_id(entry_size, entry_type,
entry_ident, 0);
stmf_append_id((stmf_id_list_t *)id_grp->id_impl_specific, id_member);