diff options
author | Sreekanth Reddy <sreekanth.reddy@avagotech.com> | 2015-11-11 17:30:30 +0530 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2015-11-11 18:57:38 -0500 |
commit | d1cb5e495e5384f6d90a8573f1be9cc79b85c862 (patch) | |
tree | 1600d3477752a7f90e2e8812a80eef0511393d4d /virt | |
parent | 422630955ea34841a2a074cb6734ec5d70758b0d (diff) | |
download | linux-stable-d1cb5e495e5384f6d90a8573f1be9cc79b85c862.tar.gz linux-stable-d1cb5e495e5384f6d90a8573f1be9cc79b85c862.tar.bz2 linux-stable-d1cb5e495e5384f6d90a8573f1be9cc79b85c862.zip |
mpt3sas: Refcount sas_device objects and fix unsafe list usage
sas_device 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.
This patch is ported from the following mpt2sas driver commit
d224fe0d6097 ("mpt2sas: Refcount sas_device objects and fix unsafe list
usage").
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions