Skip to content
Commit d224fe0d authored by Calvin Owens's avatar Calvin Owens Committed by James Bottomley
Browse files

mpt2sas: Refcount sas_device objects and fix unsafe list usage



These objects can be referenced concurrently throughout the driver, we
need a way to make sure threads can't delete them out from under each
other. This patch adds the refcount, and refactors the code to use it.

Additionally, we cannot iterate over the sas_device_list without
holding the lock, or we risk corrupting random memory if items are
added or deleted as we iterate. This patch refactors _scsih_probe_sas()
to use the sas_device_list in a safe way.

Signed-off-by: default avatarCalvin Owens <calvinowens@fb.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
Tested-by: default avatarChaitra Basappa <chaitra.basappa@avagotech.com>
Acked-by: default avatarSreekanth Reddy <sreekanth.reddy@avagotech.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent 710105fd
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment