[PATCH 3.4.106] SCSI: libsas: no expander revalidation for SAS_END_DEV

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The kernel crashed in mutex_lock called from smp_execute_task. The reason
is that the mutex is initialized only for devices with type EDGE_DEV or
FANOUT_DEV, but in some cases smp_execute_task gets called in the expander
revalidation context for end devices too. Expander revalidation should not
be performed for non-expander devices since they are discovered via their
IDENTIFY frames and probing for expander capabilities is not required.

Signed-off-by: Praveen Murali <pmurali@xxxxxxxxxxxx>
---
 drivers/scsi/libsas/sas_discover.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c
index 629a086..333a400 100644
--- a/drivers/scsi/libsas/sas_discover.c
+++ b/drivers/scsi/libsas/sas_discover.c
@@ -445,6 +445,7 @@ static void sas_revalidate_domain(struct work_struct *work)
 	int res = 0;
 	struct sas_discovery_event *ev = to_sas_discovery_event(work);
 	struct asd_sas_port *port = ev->port;
+	struct domain_device *ddev = port->port_dev;
 	struct sas_ha_struct *ha = port->ha;
 
 	/* prevent revalidation from finding sata links in recovery */
@@ -460,8 +461,9 @@ static void sas_revalidate_domain(struct work_struct *work)
 	SAS_DPRINTK("REVALIDATING DOMAIN on port %d, pid:%d\n", port->id,
 		    task_pid_nr(current));
 
-	if (port->port_dev)
-		res = sas_ex_revalidate_domain(port->port_dev);
+	/* perform expander revalidation for sas expander devices */
+	if (ddev && (ddev->dev_type == EDGE_DEV || ddev->dev_type == FANOUT_DEV))
+		res = sas_ex_revalidate_domain(ddev);
 
 	SAS_DPRINTK("done REVALIDATING DOMAIN on port %d, pid:%d, res 0x%x\n",
 		    port->id, task_pid_nr(current), res);
-- 
2.1.4

��.n��������+%������w��{.n�����{������ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux