Skip to content
Commit 5381837f authored by Tom Peng's avatar Tom Peng Committed by James Bottomley
Browse files

[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: default avatarTom Peng <tom_peng@usish.com>
Signed-off-by: default avatarJack Wang <jack_wang@usish.com>
Signed-off-by: default avatarLindar Liu <lindar_liu@usish.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 35b5c55f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment