2002-03-04 16:03:56

by Vitaly Fertman

[permalink] [raw]
Subject: bug report


Hi all,

a problem occured while testing our mkreiserfs utility with different
blocksizes. Now we have the following situation:

ioctl (fd, BLKGETSIZE, &size) returns 5735142 of 512-byte blocks.

1. mkreiserfs /dev/hdf8 --block-size 1024
no problem, block count == 2867571

2. mkreiserfs /dev/hdf8 --blocksize 2048(or 4096)
no problem, block count == 1433785 (or 716892)

3. mount /dev/hdf8, umount

4. mkreiserfs /dev/hdf8 --blocksize 1024(or 2048)
block count == 2867567 (or 1433783), it is a bit different!

ioctl (fd, BLKGETSIZE, &size) always returns the same result,
but we just cannot read the last 3k bytes.

The small program (attached) shows interesting results also.

After

1. mkreiserfs /dev/hdf8 --block-size 1024
2. mount/umount

lseek64 SEEK_END to 2936392704
lseek64 to 2936392704
read a byte
lseek64 to 2936392192
read a byte
lseek64 to 2936391680
read a byte
lseek64 to 2936391168
read a byte
lseek64 to 2936390656
read a byte
lseek64 to 2936390144
read a byte
lseek64 to 2936389632
read a byte
lseek64 to 2936389120
read a byte
lseek64 to 2936388608
read a byte
lseek64 to 2936388096
read a byte
lseek64 to 2936387584
read a byte
lseek64 to 2936387072
read a byte

After

1. mkreiserfs /dev/hdf8 --block-size 2048/4096
2. mount/umount

lseek64 SEEK_END to 2936392704
lseek64 to 2936392704
read a byte
lseek64 to 2936392192
cannot read Input/output error
lseek64 to 2936391680
cannot read Input/output error
lseek64 to 2936391168
cannot read Input/output error
lseek64 to 2936390656
cannot read Input/output error
lseek64 to 2936390144
cannot read Input/output error
lseek64 to 2936389632
cannot read Input/output error
lseek64 to 2936389120
read a byte
lseek64 to 2936388608
read a byte
lseek64 to 2936388096
read a byte
lseek64 to 2936387584
read a byte
lseek64 to 2936387072
read a byte

kernels 2.5.3, 2.4.18.

--

Thanks,
Vitaly Fertman


Attachments:
read_last_bytes.c (925.00 B)