linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@transmeta.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Christoph Hellwig <hch@lst.de>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] loop sendfile retval
Date: Mon, 11 Nov 2002 08:53:09 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0211110846270.1805-100000@home.transmeta.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0211111626160.9968-100000@localhost.localdomain>


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


  reply	other threads:[~2002-11-11 16:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-11 16:38 [PATCH] loop sendfile retval Hugh Dickins
2002-11-11 16:53 ` Linus Torvalds [this message]
2002-11-11 17:48   ` Hugh Dickins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0211110846270.1805-100000@home.transmeta.com \
    --to=torvalds@transmeta.com \
    --cc=hch@lst.de \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).