mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Jens Axboe <axboe@suse.de>,
	Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: BUG in the block layer (partial reads not reported)
Date: Sat, 22 Oct 2005 19:23:10 +0100	[thread overview]
Message-ID: <1130005390.15961.32.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0510221117160.3707-100000@netrider.rowland.org>

On Sad, 2005-10-22 at 11:40 -0400, Alan Stern wrote:
> 	Handling an error somewhere in the middle of the medium, and
> 
> 	Handling an error beyond the real end of the medium.
> 
> The mm and block subsystems have no way at all to retrieve partial data
> for the first case.  Even though only one hardware sector may be bad,

The block layer can handle this at the bottom level but the caches above
it cannot. 

> failure to read an entire page means that none of the good sectors on that
> page will be accessible.  While annoying, it's understandable and I don't 
> see any simple way to accomodate such partial reads.

Agreed it is hairy with things like mmap. One way is to use raw I/O and
disable readahead.

> The second case appears to be more tractable, as you said.  In fact,
> do_generic_mapping_read() in mm/filemap.c will recheck the inode's size
> after a successful read, to avoid copying data beyond the end of the
> device.
> 
> Could part of the problem also be that the set_capacity() call, used to
> revise the device size downward when the CD driver realizes it is smaller
> than originally thought, doesn't update the inode?  Should the driver call
> bd_set_size() as well?  (In addition to completing the read successfully
> with garbage data beyond the actual EOF.)

Beats me. Perhaps Jens can enlighten us and I can improve the ide-cd
driver code further as well.


  reply	other threads:[~2005-10-22 17:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-20 20:39 Alan Stern
2005-10-21 17:31 ` Alan Cox
2005-10-22 15:40   ` Alan Stern
2005-10-22 18:23     ` Alan Cox [this message]
2005-10-24 21:28       ` Alan Stern
2005-10-23 22:12   ` Helge Hafting
2005-10-23 23:14     ` Alan Cox

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=1130005390.15961.32.camel@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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

all inboxes | Powered by JetHome®