summaryrefslogtreecommitdiff
path: root/drivers/infiniband/ulp/srp/ib_srp.h
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2014-03-14 12:52:45 (GMT)
committerRoland Dreier <roland@purestorage.com>2014-03-24 17:05:31 (GMT)
commit2d7091bcf6f893a9b1a2add357c637055eae4e68 (patch)
tree10af70bb397f7c23f3d6f581a37a1a557d53abbd /drivers/infiniband/ulp/srp/ib_srp.h
parente7ffde0164b1a580f66ea3b95081626107931d3c (diff)
downloadlinux-2d7091bcf6f893a9b1a2add357c637055eae4e68.tar.xz
IB/srp: Avoid duplicate connections
The connection uniqueness check is performed before a new connection is added to the target list. This patch protects both actions by a mutex such that simultaneous writes from two different threads into the "add_target" variable do not result in duplicate connections. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/ulp/srp/ib_srp.h')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
index 5756810..aad27b7 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.h
+++ b/drivers/infiniband/ulp/srp/ib_srp.h
@@ -105,6 +105,7 @@ struct srp_host {
spinlock_t target_lock;
struct completion released;
struct list_head list;
+ struct mutex add_target_mutex;
};
struct srp_request {