summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_srp.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2017-08-11 08:53:47 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2017-08-25 04:28:53 +0200
commit8a97712e5314aefe16b3ffb4583a34deaa49de04 (patch)
treef7697a26c31ded4a2a97bac3fec36c90ce14228a /drivers/scsi/scsi_transport_srp.c
parentscsi: scsi_lib: rework scsi_internal_device_unblock_nowait() (diff)
downloadlinux-8a97712e5314aefe16b3ffb4583a34deaa49de04.tar.xz
linux-8a97712e5314aefe16b3ffb4583a34deaa49de04.zip
scsi: make 'state' device attribute pollable
While the 'state' attribute can (and will) change occasionally, calling 'poll()' or 'select()' on it fails as sysfs is never notified that the state has changed. With this patch calling 'poll()' or 'select()' will work properly. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_srp.c')
-rw-r--r--drivers/scsi/scsi_transport_srp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c
index f617021c94f7..698cc4681706 100644
--- a/drivers/scsi/scsi_transport_srp.c
+++ b/drivers/scsi/scsi_transport_srp.c
@@ -556,8 +556,11 @@ int srp_reconnect_rport(struct srp_rport *rport)
*/
shost_for_each_device(sdev, shost) {
mutex_lock(&sdev->state_mutex);
- if (sdev->sdev_state == SDEV_OFFLINE)
+ if (sdev->sdev_state == SDEV_OFFLINE) {
sdev->sdev_state = SDEV_RUNNING;
+ sysfs_notify(&sdev->sdev_gendev.kobj,
+ NULL, "state");
+ }
mutex_unlock(&sdev->state_mutex);
}
} else if (rport->state == SRP_RPORT_RUNNING) {