Targets should be deleted after all its sessions deleted

Each session on delete is looking for each target.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4726 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2013-01-09 01:38:05 +00:00
parent c3910d8367
commit ae6485796d
+7 -2
View File
@@ -339,8 +339,6 @@ int target_del(u32 tid, u32 cookie)
if (!target)
return -ENOENT;
list_del(&target->tlist);
while (1) {
/* We might need to handle session(s) removal event(s) from the kernel */
while (handle_iscsi_events(nl_fd, false) == 0);
@@ -353,6 +351,13 @@ int target_del(u32 tid, u32 cookie)
usleep(50000);
}
/*
* Remove target from the list after waiting for all sessions
* deleted, because we are looking for this target in list during
* each session delete.
*/
list_del(&target->tlist);
if (target->tgt_enabled)
isns_target_deregister(target->name);