@@ -1082,7 +1082,16 @@ static ssize_t tcm_loop_tpg_store_transport_status(
struct tcm_loop_tpg, tl_se_tpg);
if (!strncmp(page, "online", 6)) {
+ int status = tl_tpg->tl_transport_status;
+
tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE;
+ if (status != tl_tpg->tl_transport_status &&
+ tl_tpg->tl_hba->tl_proto_id == SCSI_PROTOCOL_SAS) {
+ struct sas_rphy *rphy = tl_tpg->sas_rphy;
+
+ scsi_scan_target(&rphy->dev, 0, rphy->scsi_target_id,
+ SCAN_WILD_CARD, 0);
+ }
return count;
}
if (!strncmp(page, "offline", 7)) {
Setting the transport status to 'online' needs to rescan the target, as some devices might have been added while the transport has been offline. Signed-off-by: Hannes Reinecke <hare@suse.de> --- drivers/target/loopback/tcm_loop.c | 9 +++++++++ 1 file changed, 9 insertions(+)