isert: Avoid hanging scst_mgmtd in case of login response send failure

The following is seen if isert_login_rsp_tx fails, since we do not destroy the created sysfs.

[  840.532111] INFO: task scst_mgmtd:4614 blocked for more than 120 seconds.
[  840.532174] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  840.532230] scst_mgmtd      D ffff8800371c4ee0     0  4614      2 0x00000000
[  840.532233]  ffff8800378d1bd8 0000000000000046 ffff8800378d1b78 ffff88007e513ec0
[  840.532236]  ffff8800378d1fd8 ffff8800378d1fd8 ffff8800378d1fd8 0000000000013ec0
[  840.532238]  ffff880077b28000 ffff8800379c9740 ffff8800378d1bc8 7fffffffffffffff
[  840.532241] Call Trace:
[  840.532249]  [<ffffffff816f33b9>] schedule+0x29/0x70
[  840.532253]  [<ffffffff816f1b35>] schedule_timeout+0x1e5/0x250
[  840.532259]  [<ffffffff8105b36a>] ? console_unlock+0x1a/0x30
[  840.532263]  [<ffffffff816f320f>] wait_for_common+0xdf/0x180
[  840.532286]  [<ffffffffa05efaf5>] ? debug_print_with_prefix+0x165/0x1f0 [scst]
[  840.532289]  [<ffffffff81092190>] ? try_to_wake_up+0x200/0x200
[  840.532291]  [<ffffffff816f338d>] wait_for_completion+0x1d/0x20
[  840.532302]  [<ffffffffa05e1307>] scst_kobject_put_and_wait+0x177/0x220 [scst]
[  840.532314]  [<ffffffffa05e8d13>] scst_sess_sysfs_del+0xb3/0x180 [scst]
[  840.532324]  [<ffffffffa05d747a>] scst_free_session+0xaa/0x2c0 [scst]
[  840.532326]  [<ffffffff816f1eed>] ? mutex_lock+0x1d/0x50
[  840.532336]  [<ffffffffa05d772c>] scst_free_session_callback+0x9c/0x170 [scst]
[  840.532343]  [<ffffffffa05b14fe>] ? __raw_spin_unlock_irq+0xe/0x10 [scst]
[  840.532350]  [<ffffffffa05c4370>] scst_global_mgmt_thread+0x2e0/0x560 [scst]
[  840.532354]  [<ffffffff8107fdd0>] ? add_wait_queue+0x60/0x60
[  840.532362]  [<ffffffffa05c4090>] ? scst_register_session_non_gpl+0x20/0x20 [scst]
[  840.532364]  [<ffffffff8107f210>] kthread+0xc0/0xd0
[  840.532366]  [<ffffffff8107f150>] ? flush_kthread_worker+0xb0/0xb0
[  840.532369]  [<ffffffff816fd0ac>] ret_from_fork+0x7c/0xb0
[  840.532372]  [<ffffffff8107f150>] ? flush_kthread_worker+0xb0/0xb0

Signed-off-by: Yan Burman <yanb@mellanox.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5342 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Yan Burman
2014-03-19 14:30:48 +00:00
parent a89367848e
commit a892d7b0b3

View File

@@ -241,16 +241,9 @@ int isert_conn_alloc(struct iscsi_session *session,
if (unlikely(res))
goto cleanup_conn;
#ifndef CONFIG_SCST_PROC
res = conn_sysfs_add(conn);
if (unlikely(res))
goto cleanup_iscsi_conn;
#endif
conn->rd_state = 1;
isert_dev_release(dev);
list_add_tail(&conn->conn_list_entry, &session->conn_list);
res = isert_login_rsp_tx(cmnd, true, false);
vunmap(dev->sg_virt);
dev->sg_virt = NULL;
@@ -258,12 +251,19 @@ int isert_conn_alloc(struct iscsi_session *session,
if (unlikely(res))
goto cleanup_iscsi_conn;
#ifndef CONFIG_SCST_PROC
res = conn_sysfs_add(conn);
if (unlikely(res))
goto cleanup_iscsi_conn;
#endif
list_add_tail(&conn->conn_list_entry, &session->conn_list);
goto out;
cleanup_iscsi_conn:
if (conn->nop_in_interval > 0)
cancel_delayed_work_sync(&conn->nop_in_delayed_work);
list_del(&conn->conn_list_entry);
cleanup_conn:
conn->session = NULL;
isert_close_connection(conn);