public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 14/13] opensm/osm_sa_guidinfo_record.c: Fix locking
@ 2011-05-21 14:56 Hal Rosenstock
  0 siblings, 0 replies; only message in thread
From: Hal Rosenstock @ 2011-05-21 14:56 UTC (permalink / raw)
  To: Alex Netes; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org


Fix locking around set_guidinfo/del_guidinfo

Found and fixed by: Alex Netes <alexne-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
diff --git a/opensm/osm_sa_guidinfo_record.c b/opensm/osm_sa_guidinfo_record.c
index c792943..a1bb166 100644
--- a/opensm/osm_sa_guidinfo_record.c
+++ b/opensm/osm_sa_guidinfo_record.c
@@ -737,10 +737,12 @@ void osm_gir_rcv_process(IN void *ctx, IN void *data)
 		if (!osm_physp_share_pkey(sa->p_log, p_req_physp,
 					  p_port->p_physp))
 			goto Exit;
+		CL_PLOCK_EXCL_ACQUIRE(sa->p_lock);
 		if (p_rcvd_mad->method == IB_MAD_METHOD_SET)
 			set_guidinfo(sa, p_madw, p_port, p_rcvd_rec->block_num);
 		else
 			del_guidinfo(sa, p_madw, p_port, p_rcvd_rec->block_num);
+		CL_PLOCK_RELEASE(sa->p_lock);
 		break;
 	default:
 		OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 5105: "
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-21 14:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-21 14:56 [PATCH 14/13] opensm/osm_sa_guidinfo_record.c: Fix locking Hal Rosenstock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox