diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2009-07-13 09:06:03 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-07-30 09:49:54 -0400 |
commit | acf7b86150701de105aa8307b4b3f9dc533c45bb (patch) | |
tree | 3478d074c3a013d6c256d9c3098b6451a8a38264 /drivers/s390 | |
parent | dfb3cf00e402686f671db697adbd8b9f4c219268 (diff) |
[SCSI] zfcp: Acquire qdio_stat_lock when reading the queue utilization
req_q_util is not atomic, so the qdio_stat_lock must be held when
reading this variable.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c index 3e51e64d1108..0fe5cce818cb 100644 --- a/drivers/s390/scsi/zfcp_sysfs.c +++ b/drivers/s390/scsi/zfcp_sysfs.c | |||
@@ -494,9 +494,14 @@ static ssize_t zfcp_sysfs_adapter_q_full_show(struct device *dev, | |||
494 | struct Scsi_Host *scsi_host = class_to_shost(dev); | 494 | struct Scsi_Host *scsi_host = class_to_shost(dev); |
495 | struct zfcp_adapter *adapter = | 495 | struct zfcp_adapter *adapter = |
496 | (struct zfcp_adapter *) scsi_host->hostdata[0]; | 496 | (struct zfcp_adapter *) scsi_host->hostdata[0]; |
497 | u64 util; | ||
498 | |||
499 | spin_lock_bh(&adapter->qdio_stat_lock); | ||
500 | util = adapter->req_q_util; | ||
501 | spin_unlock_bh(&adapter->qdio_stat_lock); | ||
497 | 502 | ||
498 | return sprintf(buf, "%d %llu\n", atomic_read(&adapter->qdio_outb_full), | 503 | return sprintf(buf, "%d %llu\n", atomic_read(&adapter->qdio_outb_full), |
499 | (unsigned long long)adapter->req_q_util); | 504 | (unsigned long long)util); |
500 | } | 505 | } |
501 | static DEVICE_ATTR(queue_full, S_IRUGO, zfcp_sysfs_adapter_q_full_show, NULL); | 506 | static DEVICE_ATTR(queue_full, S_IRUGO, zfcp_sysfs_adapter_q_full_show, NULL); |
502 | 507 | ||