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] > > > [EMAIL PROTECTED]:~# uname -a > > > Linux darkside 2.4.27 #1 Sat Jan 15 17:07:20 CET 2005 i686 GNU/Linux > > > [EMAIL PROTECTED]:~# dd if=/dev/hdg7 of=/dev/null > > > 9992366+0 records in > > > 9992366+0 records out > > > [EMAIL PROTECTED]:~# mount -t ext2 -o ro /dev/hdg7 /mnt > > > [EMAIL PROTECTED]:~# umount /dev/hdg7 > > > [EMAIL PROTECTED]:~# 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 > > > [EMAIL PROTECTED]:~# 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. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/