From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To: konishi.ryusuke@lab.ntt.co.jp
Cc: stgt@vger.kernel.org
Subject: Re: [PATCH] iscsi: fix leak of task for delayed management request
Date: Sat, 22 Mar 2014 20:57:25 +0900 [thread overview]
Message-ID: <20140322205135N.fujita.tomonori@lab.ntt.co.jp> (raw)
In-Reply-To: <1395109198-15307-1-git-send-email-konishi.ryusuke@lab.ntt.co.jp>
On Tue, 18 Mar 2014 11:19:58 +0900
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> wrote:
> Fix the following crash of tgtd which occured when removing a target
> with --force option:
>
> conn_close(90) already closed 0x2058598 1
> iscsi_target_destroy(416) bug still have sessions 91
>
> This crash happens if a task remains after the following calls of
> conn_close() function for every connection on the target.
>
> list_for_each_entry_safe(session, stmp, &target->sessions_list, slist) {
> list_for_each_entry_safe(conn, ctmp, &session->conn_list, clist) {
> conn_close(conn);
> }
> }
>
> The leaked task turned out to be a task for handling ABORT_TASK
> management request which was delayed due to a flying io. The delayed
> management request is attached to cmd->mreq of the io command and is
> completed by iscsi_tm_done() function. However, this function fails
> with the following error and leaks the task if associated connection
> (task->conn) is already closed:
>
> tgt_event_modify(245) Cannot find event 25
> iscsi_event_modify(560) tgt_event_modify failed
>
> This fixes the issue by freeing task in iscsi_tm_done() if state of
> the connection is STATE_CLOSE.
>
> Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
> ---
> usr/iscsi/iscsid.c | 5 +++++
> 1 file changed, 5 insertions(+)
Great catch! Thanks a lot!!
prev parent reply other threads:[~2014-03-22 11:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 2:19 [PATCH] iscsi: fix leak of task for delayed management request Ryusuke Konishi
2014-03-22 11:57 ` FUJITA Tomonori [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140322205135N.fujita.tomonori@lab.ntt.co.jp \
--to=fujita.tomonori@lab.ntt.co.jp \
--cc=konishi.ryusuke@lab.ntt.co.jp \
--cc=stgt@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).