* [PATCH] iscsi_tcp - make padbuf non-static
@ 2009-01-08 20:58 Karen Xie
2009-01-08 21:06 ` Mike Christie
0 siblings, 1 reply; 3+ messages in thread
From: Karen Xie @ 2009-01-08 20:58 UTC (permalink / raw)
To: open-iscsi-/JYPxA39Uh5TLH3MbocFFw,
linux-scsi-u79uwXL29TY76Z2rM5mHXA
Cc: michaelc-hcNo3dDEHLuVc3sceRu5cw,
erezzi.list-Re5JQEeQqe8AvxtiuMwx3w, kxie-ut6Up61K2wZBDgjK7y7TUQ,
James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk
[PATCH] iscsi_tcp - make padbuf non-static
From: Karen Xie <kxie-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
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-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
---
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;
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] iscsi_tcp - make padbuf non-static
2009-01-08 20:58 [PATCH] iscsi_tcp - make padbuf non-static Karen Xie
@ 2009-01-08 21:06 ` Mike Christie
2009-01-10 18:53 ` James Bottomley
0 siblings, 1 reply; 3+ messages in thread
From: Mike Christie @ 2009-01-08 21:06 UTC (permalink / raw)
To: Karen Xie; +Cc: open-iscsi, linux-scsi, erezzi.list, James.Bottomley
Karen Xie wrote:
> [PATCH] iscsi_tcp - make padbuf non-static
>
> From: Karen Xie <kxie@chelsio.com>
>
> 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>
Thanks for finding this.
Acked-by: Mike Christie <michaelc@cs.wisc.edu>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iscsi_tcp - make padbuf non-static
2009-01-08 21:06 ` Mike Christie
@ 2009-01-10 18:53 ` James Bottomley
0 siblings, 0 replies; 3+ messages in thread
From: James Bottomley @ 2009-01-10 18:53 UTC (permalink / raw)
To: Mike Christie; +Cc: Karen Xie, open-iscsi, linux-scsi, erezzi.list
On Thu, 2009-01-08 at 15:06 -0600, Mike Christie wrote:
> Karen Xie wrote:
> > [PATCH] iscsi_tcp - make padbuf non-static
> >
> > From: Karen Xie <kxie@chelsio.com>
> >
> > 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>
>
>
> Thanks for finding this.
>
> Acked-by: Mike Christie <michaelc@cs.wisc.edu>
Could one of you regenerate this against current git head, please, it
seems to have suffered from the iscsi to libiscsi move.
James
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-10 18:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-08 20:58 [PATCH] iscsi_tcp - make padbuf non-static Karen Xie
2009-01-08 21:06 ` Mike Christie
2009-01-10 18:53 ` James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox