Date: Fri, 29 Oct 2021 23:58:48 GMT From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: b2f1beeeff10 - stable/13 - iscsi: Abort data-out tasks queued on a terminating session. Message-ID: <202110292358.19TNwmwZ004253@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b2f1beeeff10e24b4da21f6d97a88f70163c7bf0 commit b2f1beeeff10e24b4da21f6d97a88f70163c7bf0 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2021-09-15 20:25:30 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2021-10-29 23:43:48 +0000 iscsi: Abort data-out tasks queued on a terminating session. cfiscsi_datamove_out() can race with cfiscsi_session_terminate_tasks() and enqueue a new task after the latter function has aborted existing tasks. This could result in a deadlock as cfiscsi_session_terminate_tasks() waited forever for this task to complete. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31892 (cherry picked from commit 0cd6e85e242bb07a33df9a6314e90bcb0ba99576) --- sys/cam/ctl/ctl_frontend_iscsi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c index ac94a786a701..b8ab25e89eb9 100644 --- a/sys/cam/ctl/ctl_frontend_iscsi.c +++ b/sys/cam/ctl/ctl_frontend_iscsi.c @@ -2783,6 +2783,11 @@ cfiscsi_datamove_out(union ctl_io *io) cdw->cdw_r2t_end = io->scsiio.ext_data_filled + r2t_len; CFISCSI_SESSION_LOCK(cs); + if (cs->cs_terminating) { + CFISCSI_SESSION_UNLOCK(cs); + cfiscsi_data_wait_abort(cs, cdw, 44); + return; + } TAILQ_INSERT_TAIL(&cs->cs_waiting_for_data_out, cdw, cdw_next); CFISCSI_SESSION_UNLOCK(cs);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110292358.19TNwmwZ004253>