Re: fix stgt crash in conn_close

Anton Kovalenko <[email protected]> Mon, 25 Jul 2016 11:11:33 +0300
Newsgroups org.kernel.vger.stgt
Message-ID <[email protected]>
Anton Kovalenko <[email protected]> writes:

>
>> hello!
>> we found tgtd happen core dump and fix it=E3=80=82

[...]

> I'm attaching my own version of a preliminary fix, that avoids examin=
ing
> the entire cmd_list on each task deallocation.

On a second though, I think a conditional list_del(&task->c_hlist) in
iscsi_free_task is good enough, but then we'd probably get rid of the
*unconditional* list_del in iscsi_free_cmd_task, making iscsi_free_task
responsible for task unlinking from c_hlist (it *is* responsible for
unlinking from c_siblings anyway).

What bothers me now is that a task removed from cmdlist, being a SCSI
command, is probably not supposed to be freed without calling
target_cmd_done (or is it?). I'm unsure if it might cause a resource
leak of some kind.


--=20
Regards, Anton Kovalenko | +7(916)345-34-02 | Elektrostal' MO, Russia