mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-18 13:16:34 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user