aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srpt/ib_srpt.h
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@wdc.com>2018-01-16 16:14:15 -0800
committerDoug Ledford <dledford@redhat.com>2018-01-18 14:49:26 -0500
commitfcf589364f2a106544d79594dcf722d97528031b (patch)
tree7894077b2fc9b995506ad2b897dc7a44c1921277 /drivers/infiniband/ulp/srpt/ib_srpt.h
parentIB/srpt: Fix a race condition related to wait list processing (diff)
downloadlinux-dev-fcf589364f2a106544d79594dcf722d97528031b.tar.xz
linux-dev-fcf589364f2a106544d79594dcf722d97528031b.zip
IB/srpt: Don't allow reordering of commands on wait list
If a receive I/O context is removed from the wait list and srpt_handle_new_iu() fails to allocate a send I/O context then re-adding the receive I/O context to the wait list can cause reordering. Avoid this by only removing a receive I/O context from the wait list after allocating a send I/O context succeeded. Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/ulp/srpt/ib_srpt.h')
-rw-r--r--drivers/infiniband/ulp/srpt/ib_srpt.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.h b/drivers/infiniband/ulp/srpt/ib_srpt.h
index 59261d5de292..10f9b2667ef2 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.h
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.h
@@ -261,6 +261,7 @@ enum rdma_ch_state {
* @spinlock: Protects free_list and state.
* @free_list: Head of list with free send I/O contexts.
* @state: channel state. See also enum rdma_ch_state.
+ * @processing_wait_list: Whether or not cmd_wait_list is being processed.
* @ioctx_ring: Send ring.
* @ioctx_recv_ring: Receive I/O context ring.
* @list: Node in srpt_nexus.ch_list.
@@ -295,6 +296,7 @@ struct srpt_rdma_ch {
struct list_head list;
struct list_head cmd_wait_list;
uint16_t pkey;
+ bool processing_wait_list;
struct se_session *sess;
u8 sess_name[24];
struct work_struct release_work;