diff options
author | Chandra Seetharaman <sekharan@us.ibm.com> | 2009-09-11 13:20:35 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 13:01:29 -0500 |
commit | 5917290ce9b376866b165d02a5ed88d5ecdb32d0 (patch) | |
tree | c659dcfa0b5e8fecb14484f24bc55c8e104b6300 /drivers/scsi | |
parent | cd7560cb69489c6b798b61897449989b4e972327 (diff) |
[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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/device_handler/scsi_dh.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh.c b/drivers/scsi/device_handler/scsi_dh.c index 6f7f798910e8..e19a1a55270c 100644 --- a/drivers/scsi/device_handler/scsi_dh.c +++ b/drivers/scsi/device_handler/scsi_dh.c | |||
@@ -304,18 +304,15 @@ static int scsi_dh_notifier(struct notifier_block *nb, | |||
304 | sdev = to_scsi_device(dev); | 304 | sdev = to_scsi_device(dev); |
305 | 305 | ||
306 | if (action == BUS_NOTIFY_ADD_DEVICE) { | 306 | if (action == BUS_NOTIFY_ADD_DEVICE) { |
307 | err = device_create_file(dev, &scsi_dh_state_attr); | ||
308 | /* don't care about err */ | ||
307 | devinfo = device_handler_match(NULL, sdev); | 309 | devinfo = device_handler_match(NULL, sdev); |
308 | if (!devinfo) | 310 | if (devinfo) |
309 | goto out; | 311 | err = scsi_dh_handler_attach(sdev, devinfo); |
310 | |||
311 | err = scsi_dh_handler_attach(sdev, devinfo); | ||
312 | if (!err) | ||
313 | err = device_create_file(dev, &scsi_dh_state_attr); | ||
314 | } else if (action == BUS_NOTIFY_DEL_DEVICE) { | 312 | } else if (action == BUS_NOTIFY_DEL_DEVICE) { |
315 | device_remove_file(dev, &scsi_dh_state_attr); | 313 | device_remove_file(dev, &scsi_dh_state_attr); |
316 | scsi_dh_handler_detach(sdev, NULL); | 314 | scsi_dh_handler_detach(sdev, NULL); |
317 | } | 315 | } |
318 | out: | ||
319 | return err; | 316 | return err; |
320 | } | 317 | } |
321 | 318 | ||