[stgt] [PATCH 3/3] Fix segfault on exit

Andy Grover agrover at redhat.com
Fri Sep 30 01:07:48 CEST 2011


If iser_ib_init fails (due to no RDMA-capable hw, which is ok) and
iser_send_nop is 1, then tgtd will segfault on exit, trying to remove
the work item that was never initialized or added.

See https://bugzilla.redhat.com/show_bug.cgi?id=712807 for more info.

Signed-off-by: Andy Grover <agrover at redhat.com>
---
 usr/iscsi/iser.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/usr/iscsi/iser.c b/usr/iscsi/iser.c
index a582bdf..7c263f5 100644
--- a/usr/iscsi/iser.c
+++ b/usr/iscsi/iser.c
@@ -3336,8 +3336,10 @@ static int iser_init(int index, char *args)
 	int err;
 
 	err = iser_ib_init();
-	if (err)
+	if (err) {
+		iser_send_nop = 0;
 		return err;
+	}
 
 	if (iser_send_nop) {
 		nop_work.func = iser_nop_work_handler;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list