summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Oberparleiter <oberpar@linux.ibm.com>2025-06-03 20:21:56 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-06-27 11:02:56 +0100
commit48222a330de4fc72830016ff118d7e73d572d3d6 (patch)
tree5769440a4527f4525e08f4090f87da4380fa2457
parent8bc89302f3855be0f910bcd468da97d716ba111a (diff)
downloadlinux-48222a330de4fc72830016ff118d7e73d572d3d6.tar.gz
linux-48222a330de4fc72830016ff118d7e73d572d3d6.tar.bz2
linux-48222a330de4fc72830016ff118d7e73d572d3d6.zip
scsi: s390: zfcp: Ensure synchronous unit_add
commit 9697ca0d53e3db357be26d2414276143c4a2cd49 upstream. Improve the usability of the unit_add sysfs attribute by ensuring that the associated FCP LUN scan processing is completed synchronously. This enables configuration tooling to consistently determine the end of the scan process to allow for serialization of follow-on actions. While the scan process associated with unit_add typically completes synchronously, it is deferred to an asynchronous background process if unit_add is used before initial remote port scanning has completed. This occurs when unit_add is used immediately after setting the associated FCP device online. To ensure synchronous unit_add processing, wait for remote port scanning to complete before initiating the FCP LUN scan. Cc: stable@vger.kernel.org Reviewed-by: M Nikhil <nikh1092@linux.ibm.com> Reviewed-by: Nihar Panda <niharp@linux.ibm.com> Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com> Signed-off-by: Nihar Panda <niharp@linux.ibm.com> Link: https://lore.kernel.org/r/20250603182252.2287285-2-niharp@linux.ibm.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/s390/scsi/zfcp_sysfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c
index af197e2b3e69..2a4e5c3f1a5f 100644
--- a/drivers/s390/scsi/zfcp_sysfs.c
+++ b/drivers/s390/scsi/zfcp_sysfs.c
@@ -355,6 +355,8 @@ static ssize_t zfcp_sysfs_unit_add_store(struct device *dev,
if (kstrtoull(buf, 0, (unsigned long long *) &fcp_lun))
return -EINVAL;
+ flush_work(&port->rport_work);
+
retval = zfcp_unit_add(port, fcp_lun);
if (retval)
return retval;