Commit 2856830b authored by Karen Xie's avatar Karen Xie Committed by James Bottomley

[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: default avatarKaren Xie <kxie@chelsio.com>
Acked-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 2f4c782c
...@@ -177,7 +177,6 @@ int iscsi_tcp_segment_done(struct iscsi_tcp_conn *tcp_conn, ...@@ -177,7 +177,6 @@ int iscsi_tcp_segment_done(struct iscsi_tcp_conn *tcp_conn,
struct iscsi_segment *segment, int recv, struct iscsi_segment *segment, int recv,
unsigned copied) unsigned copied)
{ {
static unsigned char padbuf[ISCSI_PAD_LEN];
struct scatterlist sg; struct scatterlist sg;
unsigned int pad; unsigned int pad;
...@@ -233,7 +232,7 @@ int iscsi_tcp_segment_done(struct iscsi_tcp_conn *tcp_conn, ...@@ -233,7 +232,7 @@ int iscsi_tcp_segment_done(struct iscsi_tcp_conn *tcp_conn,
debug_tcp("consume %d pad bytes\n", pad); debug_tcp("consume %d pad bytes\n", pad);
segment->total_size += pad; segment->total_size += pad;
segment->size = pad; segment->size = pad;
segment->data = padbuf; segment->data = segment->padbuf;
return 0; return 0;
} }
} }
......
...@@ -39,6 +39,7 @@ struct iscsi_segment { ...@@ -39,6 +39,7 @@ struct iscsi_segment {
unsigned int total_copied; unsigned int total_copied;
struct hash_desc *hash; struct hash_desc *hash;
unsigned char padbuf[ISCSI_PAD_LEN];
unsigned char recv_digest[ISCSI_DIGEST_SIZE]; unsigned char recv_digest[ISCSI_DIGEST_SIZE];
unsigned char digest[ISCSI_DIGEST_SIZE]; unsigned char digest[ISCSI_DIGEST_SIZE];
unsigned int digest_len; unsigned int digest_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment