tmp_suning_uos_patched/drivers/target/iscsi
Roland Dreier d5627acba9 iscsi-target: Fix missed wakeup race in TX thread
The sleeping code in iscsi_target_tx_thread() is susceptible to the classic
missed wakeup race:

 - TX thread finishes handle_immediate_queue() and handle_response_queue(),
   thinks both queues are empty.
 - Another thread adds a queue entry and does wake_up_process(), which does
   nothing because the TX thread is still awake.
 - TX thread does schedule_timeout() and sleeps forever.

In practice this can kill an iSCSI connection if for example an initiator
does single-threaded writes and the target misses the wakeup window when
queueing an R2T; in this case the connection will be stuck until the
initiator loses patience and does some task management operation (or kills
the connection entirely).

Fix this by converting to wait_event_interruptible(), which does not
suffer from this sort of race.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Cc: Andy Grover <agrover@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-11-01 00:38:44 -07:00
..
iscsi_target_auth.c iscsi-target: fix chap identifier simple_strtoul usage 2011-12-14 11:28:09 +00:00
iscsi_target_auth.h
iscsi_target_configfs.c iscsit: use the itt_t abstract type 2012-10-03 14:21:50 -07:00
iscsi_target_configfs.h
iscsi_target_core.h iscsi-target: Fix missed wakeup race in TX thread 2012-11-01 00:38:44 -07:00
iscsi_target_datain_values.c target/iscsi: Eliminate iscsi_cmd.data_length 2012-04-14 17:40:38 -07:00
iscsi_target_datain_values.h
iscsi_target_device.c target/iscsi: Remove unneeded wrapper functions 2012-02-25 14:37:47 -08:00
iscsi_target_device.h target/iscsi: Remove unneeded wrapper functions 2012-02-25 14:37:47 -08:00
iscsi_target_erl0.c iscsit: proper endianess conversions 2012-10-03 14:39:22 -07:00
iscsi_target_erl0.h
iscsi_target_erl1.c iscsit: use the itt_t abstract type 2012-10-03 14:21:50 -07:00
iscsi_target_erl1.h iscsit: use the itt_t abstract type 2012-10-03 14:21:50 -07:00
iscsi_target_erl2.c iscsit: proper endianess conversions 2012-10-03 14:39:22 -07:00
iscsi_target_erl2.h iscsit: proper endianess conversions 2012-10-03 14:39:22 -07:00
iscsi_target_login.c iscsi-target: Fix missed wakeup race in TX thread 2012-11-01 00:38:44 -07:00
iscsi_target_login.h
iscsi_target_nego.c iscsit: proper endianess conversions 2012-10-03 14:39:22 -07:00
iscsi_target_nego.h
iscsi_target_nodeattrib.c iscsi-target: remove improper externs 2012-03-17 18:07:04 -07:00
iscsi_target_nodeattrib.h
iscsi_target_parameters.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2012-10-10 19:52:19 +09:00
iscsi_target_parameters.h iscsi-target: Enable MaxXmitDataSegmentLength operation in login path 2012-10-02 13:17:31 -07:00
iscsi_target_seq_pdu_list.c iscsi-target: Change iscsi_target_seq_pdu_list.c to honor MaxXmitDataSegmentLength 2012-10-02 13:17:33 -07:00
iscsi_target_seq_pdu_list.h target/iscsi: Fold _decide_list_to_build into _build_pdu_and_seq_lists 2012-04-14 17:40:38 -07:00
iscsi_target_stat.c target: remove useless casts 2011-12-14 11:28:07 +00:00
iscsi_target_stat.h
iscsi_target_tmr.c iscsit: proper endianess conversions 2012-10-03 14:39:22 -07:00
iscsi_target_tmr.h
iscsi_target_tpg.c iscsi-target: Add explicit set of cache_dynamic_acls=1 for TPG demo-mode 2012-10-02 13:17:34 -07:00
iscsi_target_tpg.h
iscsi_target_tq.c iscsit: mark various functions static 2012-10-02 14:41:59 -07:00
iscsi_target_tq.h iscsit: mark various functions static 2012-10-02 14:41:59 -07:00
iscsi_target_util.c iscsi-target: Fix missed wakeup race in TX thread 2012-11-01 00:38:44 -07:00
iscsi_target_util.h iscsi-target: Fix missed wakeup race in TX thread 2012-11-01 00:38:44 -07:00
iscsi_target.c iscsi-target: Fix missed wakeup race in TX thread 2012-11-01 00:38:44 -07:00
iscsi_target.h iscsit: mark various functions static 2012-10-02 14:41:59 -07:00
Kconfig target: iscsi_target depends on NET 2011-07-28 20:16:18 +00:00
Makefile