On 2005.07.16 08:39:39 +0000, Dmitry Yusupov wrote:
>
> On Sat, 2005-07-16 at 15:27 +0900, FUJITA Tomonori wrote:
> > From: Dmitry Yusupov <dmitry_yus@xxxxxxxxx>
> > Subject: Re: [Iscsitarget-devel] file data corruption?
> > Date: Fri, 15 Jul 2005 09:56:53 -0700
> >
> > > Once BufferOffset's are in increasing order and no overlays. open-iscsi
> > > will work. Tough, it is missing important checking... so that is why
> >
> > I don't think so.
> >
> > iscsi_ctask_copy() and iscsi_data_recv() do not work if data_offset is
> > not page-aligned, if I understand the code correctly.
>
> I think you've read code correctly.
>
> > iscsi_data_recv() passes pages in an sg to iscsi_ctask_copy() in
> > order. iscsi_ctask_copy() resets conn->data_copied per data-in
> > pdu. What if the offset in the second data-in pdu is not page-aligned?
>
> i see. yep. this could be exactly the reason why Arne is seeing
> corruption. I did your patch code review. Looks OK to me, at least
> I do not see any obvious problems. Patch should indeed fix this sort
> of corruption, though we need more millage before declare a victory.
>
> Patch applied. r374.
>
> people, please try r374 and see if it breaks/improves things on your
> setups.
>
> Thanks Arne for a very nice break down of the problem.
> Thanks Tomof!
>
> Dima
>
sorry I've not follow up the whole thread, but it breaks my data digest patch.
Which I have to fix it by this one,
--- kernel/iscsi_tcp.c.1 2005-07-19 11:43:53.000000000 +0800
+++ kernel/iscsi_tcp.c 2005-07-19 15:38:37.000000000 +0800
@@ -802,6 +805,11 @@ iscsi_ctask_copy(struct iscsi_conn *conn
return -EAGAIN;
}
+ /* XXX: update ctask's data offset, otherwise we get
+ * negtive offset on received sg*/
+ if (ctask->data_offset)
+ ctask->data_offset += buf_size;
+
/* done with this buffer or with both - PDU and buffer */
conn->data_copied = 0;
return 0;
Not sure about if this is right..
-zhen
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
|