All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Andries Brouwer <aebr@win.tue.nl>
Cc: Mario Holbe <Mario.Holbe@TU-Ilmenau.DE>, linux-kernel@vger.kernel.org
Subject: Re: 2.4: "access beyond end of device" after ext2 mount
Date: Tue, 18 Jan 2005 06:45:26 -0200	[thread overview]
Message-ID: <20050118084526.GB25979@logos.cnet> (raw)
In-Reply-To: <20050118105547.GD8747@pclin040.win.tue.nl>


Hi Andries,

On Tue, Jan 18, 2005 at 11:55:47AM +0100, Andries Brouwer wrote:
> On Mon, Jan 17, 2005 at 05:46:35PM -0200, Marcelo Tosatti wrote:
> > On Sun, Jan 16, 2005 at 12:35:30AM +0100, Mario Holbe wrote:
> 
> > > mounting an ext2 (ext3 as well) filesystem seems to modify the
> > > block device's EOF behaviour: before the mount the device returned
> > > EOF, after the mount it doesn't anymore:
> > > 
> > > [on a fresh booted system]
> > > root@darkside:~# uname -a
> > > Linux darkside 2.4.27 #1 Sat Jan 15 17:07:20 CET 2005 i686 GNU/Linux
> > > root@darkside:~# dd if=/dev/hdg7 of=/dev/null
> > > 9992366+0 records in
> > > 9992366+0 records out
> > > root@darkside:~# mount -t ext2 -o ro /dev/hdg7 /mnt
> > > root@darkside:~# umount /dev/hdg7
> > > root@darkside:~# dd if=/dev/hdg7 of=/dev/null
> > > attempt to access beyond end of device
> > > 22:07: rw=0, want=4996184, limit=4996183
> > > dd: reading `/dev/hdg7': Input/output error
> > > 9992360+0 records in
> > > 9992360+0 records out
> > > root@darkside:~# bc
> > > 1249045 * 4
> > > 4996180
> > > 1249045 * 4 * 2
> > > 9992360
> > > 
> > > Could somebody please explain this to me? Is this intentional?
> > 
> > No
> > 
> > Its indeed strange.
> 
> I suppose that what happens is the following:
> mounting sets the blocksize to 4096.
> After reading 9992360 sectors, reading the next block means reading
> the next 8 sectors and that fails because only 6 sectors are left.

So this is either not a Linux error and not a disk error, its just that the
"use with filesystem" then "direct access" is a unfortunate combination.

What would be the correct fix for this for this, if any? 

v2.6 should suffer from the same issues?

> Test that this is what happens using blockdev --getbsz.
> 
> If you want to restore the device to full size, use
> blockdev --setbsz 512.




  reply	other threads:[~2005-01-18 11:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-15 23:35 2.4: "access beyond end of device" after ext2 mount Mario Holbe
2005-01-17 19:46 ` Marcelo Tosatti
2005-01-18  8:20   ` Mario Holbe
2005-01-18 10:55   ` Andries Brouwer
2005-01-18  8:45     ` Marcelo Tosatti [this message]
2005-01-18 12:15       ` Mario Holbe
2005-01-18 12:37       ` Andries Brouwer
2005-01-18 10:20         ` Marcelo Tosatti
2005-01-18 11:47     ` Mario Holbe
2005-01-18 12:39       ` Andries Brouwer
  -- strict thread matches above, loose matches on Subject: below --
2005-01-18 13:42 Piszcz, Justin Michael
2005-01-18 14:02 ` Mario Holbe
2005-01-18 14:17   ` Sytse Wielinga
2005-01-18 15:20     ` Mario Holbe
2005-01-18 15:55       ` Sytse Wielinga
2005-01-18 16:12         ` Sytse Wielinga
2005-01-18 14:05 Piszcz, Justin Michael
2005-01-18 14:15 ` Mario Holbe
2005-01-18 14:24 Piszcz, Justin Michael
2005-01-18 15:03 ` Andries Brouwer
2005-01-18 15:29 ` Mario Holbe
2005-01-18 15:07 Piszcz, Justin Michael
2005-01-18 15:42 ` Mario Holbe
     [not found] <fa.f2nt105.94e81t@ifi.uio.no>
     [not found] ` <fa.ihdogs4.bjglrq@ifi.uio.no>
2005-01-21 12:11   ` Bodo Eggert

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=20050118084526.GB25979@logos.cnet \
    --to=marcelo.tosatti@cyclades.com \
    --cc=Mario.Holbe@TU-Ilmenau.DE \
    --cc=aebr@win.tue.nl \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.