提交 1b3f6365 编写于 作者: A andrew.vasquez@qlogic.com 提交者:

[SCSI] qla2xxx: Return correct data-len during NVRAM retrieval.

Signed-off-by: NAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 f6df144c
...@@ -113,7 +113,7 @@ qla2x00_sysfs_read_nvram(struct kobject *kobj, char *buf, loff_t off, ...@@ -113,7 +113,7 @@ qla2x00_sysfs_read_nvram(struct kobject *kobj, char *buf, loff_t off,
struct device, kobj))); struct device, kobj)));
unsigned long flags; unsigned long flags;
if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->nvram_size) if (!capable(CAP_SYS_ADMIN) || off != 0)
return 0; return 0;
/* Read NVRAM. */ /* Read NVRAM. */
...@@ -122,7 +122,7 @@ qla2x00_sysfs_read_nvram(struct kobject *kobj, char *buf, loff_t off, ...@@ -122,7 +122,7 @@ qla2x00_sysfs_read_nvram(struct kobject *kobj, char *buf, loff_t off,
ha->nvram_size); ha->nvram_size);
spin_unlock_irqrestore(&ha->hardware_lock, flags); spin_unlock_irqrestore(&ha->hardware_lock, flags);
return (count); return ha->nvram_size;
} }
static ssize_t static ssize_t
...@@ -174,7 +174,7 @@ static struct bin_attribute sysfs_nvram_attr = { ...@@ -174,7 +174,7 @@ static struct bin_attribute sysfs_nvram_attr = {
.mode = S_IRUSR | S_IWUSR, .mode = S_IRUSR | S_IWUSR,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
.size = 0, .size = 512,
.read = qla2x00_sysfs_read_nvram, .read = qla2x00_sysfs_read_nvram,
.write = qla2x00_sysfs_write_nvram, .write = qla2x00_sysfs_write_nvram,
}; };
...@@ -185,7 +185,6 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha) ...@@ -185,7 +185,6 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha)
struct Scsi_Host *host = ha->host; struct Scsi_Host *host = ha->host;
sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_fw_dump_attr); sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_fw_dump_attr);
sysfs_nvram_attr.size = ha->nvram_size;
sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_nvram_attr); sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_nvram_attr);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册