[lkml]   [2002]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] loop sendfile retval
On Mon, 11 Nov 2002, Linus Torvalds wrote:
> On Mon, 11 Nov 2002, Hugh Dickins wrote:
> >
> > Buffer I/O error on device loop: its use of sendfile is (trivially)
> > broken - retval is usually count done, only an error when negative.
> Hmm.. Sendfile can return other values than "count" (ie a partial read).
> This return value change makes "do_lo_receive()" lose that information. As
> such, the new do_lo_receive() is weaker than the old one.

True, with that patch it's passing back less info than 2.5.47 tried to do;
but no less than 2.5.46 and earlier, which always returned desc.error and
ignored the desc.written, desc.count coming back from do_generic_file_read.
So it's not a regression, but of course you're right that it's weak.

> If fixing the loop code to handle partial IO is too nasty, then I would
> suggest doing maybe something like
> if (ret > 0 && ret != bvec->bv_len)
> ret = -EIO;
> which at least makes a partial IO an error instead of making it a success
> case (the code as-is seems to think that any non-negative return value
> means that the IO was fully successful).
> > Nearby spinlocking clearly bogus, delete instead of remarking on it.
> I'll apply the patch, it looks better than what is there now, but it might
> be worth fixing this _right_.

Thanks, that gets it going again. I'll step aside and leave the correct
partial handling to those who know loop much better than I - Adam?


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:30    [W:0.027 / U:6.272 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site