qubes-linux-kernel/patches.fixes/scsi-ibmvscsi-show-config.patch
2011-04-19 22:09:59 +02:00

81 lines
2.6 KiB
Diff

Subject: /sys/class/scsi_host/hostX/config doesn't show any information
From: Linda Xie <lxiep@us.ibm.com>
References: 439970 - LTC49349
Patch-mainline: not yet
This patch changes the size of the buffer used for transfering config
data to 4K. It was tested against 2.6.19-rc2 tree.
Signed-off-by: lxie@us.ibm.com
Signed-off-by: Olaf Hering <olh@suse.de>
---
drivers/scsi/ibmvscsi/ibmvscsi.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -99,6 +99,8 @@ static int max_requests = IBMVSCSI_MAX_R
static int max_events = IBMVSCSI_MAX_REQUESTS_DEFAULT + 2;
static int fast_fail = 1;
static int client_reserve = 1;
+/*host data buffer size*/
+#define buff_size 4096
static struct scsi_transport_template *ibmvscsi_transport_template;
@@ -1667,7 +1669,7 @@ static ssize_t show_host_srp_version(str
struct ibmvscsi_host_data *hostdata = shost_priv(shost);
int len;
- len = snprintf(buf, PAGE_SIZE, "%s\n",
+ len = snprintf(buf, buff_size, "%s\n",
hostdata->madapter_info.srp_version);
return len;
}
@@ -1688,7 +1690,7 @@ static ssize_t show_host_partition_name(
struct ibmvscsi_host_data *hostdata = shost_priv(shost);
int len;
- len = snprintf(buf, PAGE_SIZE, "%s\n",
+ len = snprintf(buf, buff_size, "%s\n",
hostdata->madapter_info.partition_name);
return len;
}
@@ -1709,7 +1711,7 @@ static ssize_t show_host_partition_numbe
struct ibmvscsi_host_data *hostdata = shost_priv(shost);
int len;
- len = snprintf(buf, PAGE_SIZE, "%d\n",
+ len = snprintf(buf, buff_size, "%d\n",
hostdata->madapter_info.partition_number);
return len;
}
@@ -1729,7 +1731,7 @@ static ssize_t show_host_mad_version(str
struct ibmvscsi_host_data *hostdata = shost_priv(shost);
int len;
- len = snprintf(buf, PAGE_SIZE, "%d\n",
+ len = snprintf(buf, buff_size, "%d\n",
hostdata->madapter_info.mad_version);
return len;
}
@@ -1749,7 +1751,7 @@ static ssize_t show_host_os_type(struct
struct ibmvscsi_host_data *hostdata = shost_priv(shost);
int len;
- len = snprintf(buf, PAGE_SIZE, "%d\n", hostdata->madapter_info.os_type);
+ len = snprintf(buf, buff_size, "%d\n", hostdata->madapter_info.os_type);
return len;
}
@@ -1768,7 +1770,7 @@ static ssize_t show_host_config(struct d
struct ibmvscsi_host_data *hostdata = shost_priv(shost);
/* returns null-terminated host config data */
- if (ibmvscsi_do_host_config(hostdata, buf, PAGE_SIZE) == 0)
+ if (ibmvscsi_do_host_config(hostdata, buf, buff_size) == 0)
return strlen(buf);
else
return 0;