diff --git a/SOURCES/iprutils-b6ca22d980eb67b99ddadbfec8ce83b2ab00522c.patch b/SOURCES/iprutils-b6ca22d980eb67b99ddadbfec8ce83b2ab00522c.patch new file mode 100644 index 0000000..781db08 --- /dev/null +++ b/SOURCES/iprutils-b6ca22d980eb67b99ddadbfec8ce83b2ab00522c.patch @@ -0,0 +1,38 @@ +commit b6ca22d980eb67b99ddadbfec8ce83b2ab00522c +Author: Brian King +Date: Mon May 20 16:04:49 2019 -0500 + + iprutils: Fix driver unbind on format + + When formatting a disk from JBOD to RAID, we unbind the disk + from the sd driver, including the remote path, in the case of + dual adapters, and flush unused multipaths. However, due to + a bug, this code wasn't actually working once the SCSI + host, bus, or target exceeded a single character. + + Signed-off-by: Brian King + +diff --git a/iprlib.c b/iprlib.c +index 4d3ab5f..516f069 100644 +--- a/iprlib.c ++++ b/iprlib.c +@@ -10345,7 +10345,8 @@ int ipr_jbod_sysfs_bind(struct ipr_dev *dev, u8 op) + char *sysfs_device_name; + + sysfs_device_name = dev->scsi_dev_data->sysfs_device_name; +- size = strnlen(sysfs_device_name, sizeof(sysfs_device_name)); ++ size = strnlen(sysfs_device_name, ++ sizeof(dev->scsi_dev_data->sysfs_device_name)); + + if (op == IPR_JBOD_SYSFS_BIND) { + fd = open("/sys/bus/scsi/drivers/sd/bind", O_WRONLY); +@@ -10367,7 +10368,8 @@ int ipr_jbod_sysfs_bind(struct ipr_dev *dev, u8 op) + mp_dev = find_multipath_jbod(dev); + if (mp_dev) { + sysfs_device_name = mp_dev->scsi_dev_data->sysfs_device_name; +- size = strnlen(sysfs_device_name, sizeof(sysfs_device_name)); ++ size = strnlen(sysfs_device_name, ++ sizeof(mp_dev->scsi_dev_data->sysfs_device_name)); + rc = write(fd, sysfs_device_name, size); + if (rc < 0) { + close(fd); diff --git a/SOURCES/iprutils-e4ee30417f5d093a5cc3835ff47bbafc5622d31c.patch b/SOURCES/iprutils-e4ee30417f5d093a5cc3835ff47bbafc5622d31c.patch new file mode 100644 index 0000000..8dc5b62 --- /dev/null +++ b/SOURCES/iprutils-e4ee30417f5d093a5cc3835ff47bbafc5622d31c.patch @@ -0,0 +1,27 @@ +commit e4ee30417f5d093a5cc3835ff47bbafc5622d31c +Author: Brian King +Date: Mon May 20 16:42:36 2019 -0500 + + iprutils: Fix format for RAID hang + + After completing all device formats when formatting disks for + RAID, we wait until the drives get converted from JBOD + resources to RAID device resources. We wait for 30 seconds for + this to complete. However, due to a bug, we ended up waiting here + forever. This ensures we timeout after 30 seconds. + + Signed-off-by: Brian King + +diff --git a/iprconfig.c b/iprconfig.c +index 6a5fd21..5f31beb 100644 +--- a/iprconfig.c ++++ b/iprconfig.c +@@ -232,7 +232,7 @@ static int wait_for_formatted_af_dasd(int timeout_in_secs) + int num_devs, j, af_found, jbod2af_formats, num_secs; + u64 device_id; + +- for (num_secs = 0; num_secs < timeout_in_secs; timeout_in_secs++) { ++ for (num_secs = 0; num_secs < timeout_in_secs; num_secs++) { + af_found = 0; + jbod2af_formats = 0; + scsi_devs = NULL; diff --git a/SPECS/iprutils.spec b/SPECS/iprutils.spec index b8e65e2..7fc948e 100644 --- a/SPECS/iprutils.spec +++ b/SPECS/iprutils.spec @@ -1,7 +1,7 @@ Summary: Utilities for the IBM Power Linux RAID adapters Name: iprutils Version: 2.4.17.1 -Release: 2%{?dist} +Release: 3%{?dist} License: CPL Group: System Environment/Base URL: http://sourceforge.net/projects/iprdd/ @@ -11,6 +11,11 @@ Source0: https://sourceforge.net/projects/iprdd/files/iprutils%20for%202.6%20ker # missing man page Source1: iprdbg.8.gz +# fix driver unbind on format +Patch0: iprutils-b6ca22d980eb67b99ddadbfec8ce83b2ab00522c.patch +# fix format for RAID hang +Patch1: iprutils-e4ee30417f5d093a5cc3835ff47bbafc5622d31c.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: /sbin/pidof @@ -32,6 +37,8 @@ supported by the ipr SCSI storage device driver. %prep %setup -q -n %{name}-%{version} +%patch0 -p1 +%patch1 -p1 %build export CFLAGS="%{optflags} -fno-strict-aliasing -fPIE -Wl,-z,relro,-z,now" @@ -92,6 +99,9 @@ mkdir -p $RPM_BUILD_ROOT/%{_unitdir} %{_sysconfdir}/bash_completion.d %changelog +* Thu Jul 25 2019 Than Ngo - 2.4.17.1-3 +- Resolves: #1763626 - iprconfig hangs while raiding drives on crow3 + * Sun Mar 03 2019 Than Ngo - 2.4.17.1-2 - Related: #1643408 - fix rpmdiff issue