[PATCH] iscsi_tcp - make padbuf non-static

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[PATCH] iscsi_tcp - make padbuf non-static

From: Karen Xie <kxie@xxxxxxxxxxx>

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@xxxxxxxxxxx>
---

 drivers/scsi/iscsi_tcp.c |    3 +--
 drivers/scsi/iscsi_tcp.h |    1 +
 2 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index ed6c54c..3b07868 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -190,7 +190,6 @@ iscsi_tcp_segment_splice_digest(struct iscsi_segment *segment, void *digest)
 static inline int
 iscsi_tcp_segment_done(struct iscsi_segment *segment, int recv, unsigned copied)
 {
-	static unsigned char padbuf[ISCSI_PAD_LEN];
 	struct scatterlist sg;
 	unsigned int pad;
 
@@ -245,7 +244,7 @@ iscsi_tcp_segment_done(struct iscsi_segment *segment, int recv, unsigned copied)
 		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/drivers/scsi/iscsi_tcp.h b/drivers/scsi/iscsi_tcp.h
index 498d8ca..a906db2 100644
--- a/drivers/scsi/iscsi_tcp.h
+++ b/drivers/scsi/iscsi_tcp.h
@@ -40,6 +40,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;
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux