[SCSI] scsi_dh: create sysfs file, dh_state for all SCSI disk devices
Create the sysfs file, dh_state even if the new SCSI device is not in the any of the device handler's internal lists. Signed-Off-by: Chandra Seetharaman <sekharan@us.ibm.com> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
Родитель
cd7560cb69
Коммит
5917290ce9
|
@ -304,18 +304,15 @@ static int scsi_dh_notifier(struct notifier_block *nb,
|
||||||
sdev = to_scsi_device(dev);
|
sdev = to_scsi_device(dev);
|
||||||
|
|
||||||
if (action == BUS_NOTIFY_ADD_DEVICE) {
|
if (action == BUS_NOTIFY_ADD_DEVICE) {
|
||||||
|
err = device_create_file(dev, &scsi_dh_state_attr);
|
||||||
|
/* don't care about err */
|
||||||
devinfo = device_handler_match(NULL, sdev);
|
devinfo = device_handler_match(NULL, sdev);
|
||||||
if (!devinfo)
|
if (devinfo)
|
||||||
goto out;
|
err = scsi_dh_handler_attach(sdev, devinfo);
|
||||||
|
|
||||||
err = scsi_dh_handler_attach(sdev, devinfo);
|
|
||||||
if (!err)
|
|
||||||
err = device_create_file(dev, &scsi_dh_state_attr);
|
|
||||||
} else if (action == BUS_NOTIFY_DEL_DEVICE) {
|
} else if (action == BUS_NOTIFY_DEL_DEVICE) {
|
||||||
device_remove_file(dev, &scsi_dh_state_attr);
|
device_remove_file(dev, &scsi_dh_state_attr);
|
||||||
scsi_dh_handler_detach(sdev, NULL);
|
scsi_dh_handler_detach(sdev, NULL);
|
||||||
}
|
}
|
||||||
out:
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче