lkml.org 
[lkml]   [2002]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] loop sendfile retval

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.

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_.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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