Re: Bug in block device read/write!

From: Anton Altaparmakov (aia21@cam.ac.uk)
Date: Wed Sep 13 2000 - 16:17:52 EST


It isn't when you are not using persistent super blocks, and if it were
doing so that would definitely be a bug IMO.

And anyway, it occurs without using the md driver as well (on a normal
partition as I described in my original post...).

Andries Brouwer's reply/post offered the AFAICS correct explanation that
the last sector (512b sector size) on partitions with an odd number of
sectors cannot be accessed at present due to the 1kb block size of the kernel.

Regards,

Anton

At 05:01 13/09/2000, tytso@mit.edu wrote:
> Date: Fri, 08 Sep 2000 03:41:27 +0100
> From: Anton Altaparmakov <aia21@cam.ac.uk>
>
> I have been trying to get the linear md driver to work with NTFS volumes
> for several months and it never worked. - I was suspecting the NTFS
> driver
> (after having fixed linear md and verified that at least that worked
> fine)
> but today I finally found why it doesn't work:
>
> There is a bug in reading/writing to block devices. - It manifests itself
> in the form that partitions are too small by exactly one sector!
>
> Even though a cfdisk shows that a partition has a certain number of
> sectors, you can never seek + read and/or write to the last sector (doing
> file i/o using read/write(2) [also tried fread/fwrite(3), same result]. -
> Last sector doesn't seem to exist. However reading the actual hd
> (/dev/hdb
> or /dev/sda, ie. affects both IDE and SCSI) instead of the partition
> (/dev/hdb7 or whatever) the sector does exist and contains the expected
> information!
>
>This isn't a bug. The last sector is used by the md device to store the
>md superblock.
>
> - Ted
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>Please read the FAQ at http://www.tux.org/lkml/
>-
>To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
>the body of a message to majordomo@vger.kernel.org

-- 

"Education is what remains after one has forgotten everything he learned in school." - Albert Einstein

-- Anton Altaparmakov Voice: 01223-333541(lab) / 07712-632205(mobile) Christ's College eMail: AntonA@bigfoot.com Cambridge CB2 3BU ICQ: 8561279 United Kingdom WWW: http://www-stu.christs.cam.ac.uk/~aia21/

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



This archive was generated by hypermail 2b29 : Fri Sep 15 2000 - 21:00:22 EST