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 <brking@linux.vnet.ibm.com>
This commit is contained in:
parent
78c6ab1469
commit
b6ca22d980
1 changed files with 4 additions and 2 deletions
6
iprlib.c
6
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue