summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Xie <kxie@chelsio.com>2009-01-10 19:06:07 -0800
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-01-13 10:41:34 -0600
commit2856830bd395fbc2f0c5327effe71fb025dd262d (patch)
tree213afd49b7705e653f6273db1183befde67068ed
parent2f4c782c2e06fbaef2ac2b6b7abd796b96abd98b (diff)
downloadop-kernel-dev-2856830bd395fbc2f0c5327effe71fb025dd262d.zip
op-kernel-dev-2856830bd395fbc2f0c5327effe71fb025dd262d.tar.gz
[SCSI] iscsi_tcp: make padbuf non-static
virt_to_page() call should not be used on kernel text and data addresses. virt_to_page() is used by sg_init_one(). So change padbuf to be allocated within iscsi_segment. Signed-off-by: Karen Xie <kxie@chelsio.com> Acked-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/scsi/libiscsi_tcp.c3
-rw-r--r--include/scsi/libiscsi_tcp.h1
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/libiscsi_tcp.c b/drivers/scsi/libiscsi_tcp.c
index a745f91..e7705d3 100644
--- a/drivers/scsi/libiscsi_tcp.c
+++ b/drivers/scsi/libiscsi_tcp.c
@@ -177,7 +177,6 @@ int iscsi_tcp_segment_done(struct iscsi_tcp_conn *tcp_conn,
struct iscsi_segment *segment, int recv,
unsigned copied)
{
- static unsigned char padbuf[ISCSI_PAD_LEN];
struct scatterlist sg;
unsigned int pad;
@@ -233,7 +232,7 @@ int iscsi_tcp_segment_done(struct iscsi_tcp_conn *tcp_conn,
debug_tcp("consume %d pad bytes\n", pad);
segment->total_size += pad;
segment->size = pad;
- segment->data = padbuf;
+ segment->data = segment->padbuf;
return 0;
}
}
diff --git a/include/scsi/libiscsi_tcp.h b/include/scsi/libiscsi_tcp.h
index 83e32f6..9e3182e 100644
--- a/include/scsi/libiscsi_tcp.h
+++ b/include/scsi/libiscsi_tcp.h
@@ -39,6 +39,7 @@ struct iscsi_segment {
unsigned int total_copied;
struct hash_desc *hash;
+ unsigned char padbuf[ISCSI_PAD_LEN];
unsigned char recv_digest[ISCSI_DIGEST_SIZE];
unsigned char digest[ISCSI_DIGEST_SIZE];
unsigned int digest_len;
OpenPOWER on IntegriCloud