Skip to contentSkip to conversation

iscsi_tcp - make padbuf non-static

PATCH New Karen Xie 1 participant 1 message Jan 11, 2009

Subsystems (2)
lore
Share & tools
lore

Karen Xie

author
#0 lore raw

PATCH v2 1/1 iscsi_tcp - make padbuf non-static

[PATCH v2] iscsi_tcp - make padbuf non-static

From: Karen Xie <[email protected]>

Rebased patch on scsi-misc tree head.

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.

---

 drivers/scsi/libiscsi_tcp.c |    3 +--
 include/scsi/libiscsi_tcp.h |    1 +
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/libiscsi_tcp.c +1 -2
index a745f91..e7705d3 100644
@@ -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;
 		}
 	}
include/scsi/libiscsi_tcp.h +1 -0
index 83e32f6..9e3182e 100644
@@ -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;