Tom Peng 5381837f12 [SCSI] libsas: reuse the original port when hotplugging phys in wide ports
There's a hotplug problem in the way libsas allocates ports: it loops over the
available ports first trying to add to an existing for a wide port and
otherwise allocating the next free port.  This scheme only works if the port
array is packed from zero, which fails if a port gets hot unplugged and the
array becomes sparse.  In that case, a new port is formed even if there's a
wide port it should be part of.  Fix this by creating two loops over all the
ports:  the first to see if the phy should be part of a wide port and the
second to form a new port in an empty port slot.

Signed-off-by: Tom Peng <tom_peng@usish.com>
Signed-off-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: Lindar Liu <lindar_liu@usish.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-07-16 12:50:44 -05:00
..
2009-06-12 10:02:03 -05:00
2009-06-12 10:02:03 -05:00
2009-06-15 10:09:31 -05:00
2009-07-12 12:22:34 -07:00
2009-05-15 12:23:32 -04:00
2009-05-15 12:24:59 -04:00
2009-05-15 12:24:59 -04:00
2009-06-09 10:22:45 -05:00
2009-06-15 10:09:30 -05:00
2009-06-08 12:47:40 -05:00
2009-06-12 10:02:03 -05:00