mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vitaly Fertman <vitaly@namesys.com>
To: linux-kernel@vger.kernel.org
Subject: bug report
Date: Mon, 4 Mar 2002 19:04:31 +0300	[thread overview]
Message-ID: <20020304160345Z292429-889+117297@vger.kernel.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1865 bytes --]


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

[-- Attachment #2: read_last_bytes.c --]
[-- Type: text/plain, Size: 925 bytes --]

#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64

#include <fcntl.h>
#include <sys/types.h>
#include <unistd.h>

int main ()
{
    char ch;
    loff_t res;
    int fd;
    loff_t offset;
    int i;

    offset = (unsigned long)5735142 * 512;

    fd = open ("/dev/hdf8", O_RDONLY);

    res = lseek64 (fd, 0, SEEK_END);
    if (res < 0) {
        printf ("cannot lseek64 %m\n");
        return 1;
    } else {
        printf ("lseek64 SEEK_END to %Lu\n", res);
    }

    for (i = 0; i < 12; i++) {
        res = lseek64 (fd, offset, SEEK_SET);
        if (res < 0) {
            printf ("cannot lseek64 to %Lu", offset);
	    return 1;
        } else {
            printf ("lseek64 to %Lu\n", res);
        }

        if (read (fd, &ch, 1) < 0) {
            printf ("cannot read %m\n");
//            return 1;
        } else {
            printf ("read a byte\n");
        }

        offset -= 512;
    }

    return 0;
}

             reply	other threads:[~2002-03-04 16:03 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-04 16:04 Vitaly Fertman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-08-20 22:31 Bug report mr.shroom
2012-08-20 22:43 ` Randy Dunlap
2012-08-20 23:16   ` Alan Cox
2012-08-21  9:37 ` Borislav Petkov
2011-10-28 15:55 Hendrik Knackstedt
2011-07-19 17:34 Bug Report Charles Opondo
2011-07-20 15:38 ` Bjorn Helgaas
2008-11-03 18:30 bug report Todor Gyumyushev
2008-09-25 14:08 Todor Gyumyushev
2008-09-24  9:41 Todor Gyumyushev
2008-09-24 16:38 ` Simon Holm Thøgersen
2008-09-24 17:55   ` Todor Gyumyushev
2008-09-24 18:25     ` Simon Holm Thøgersen
2008-09-29  1:36       ` Tejun Heo
2008-09-29  8:30         ` Todor Gyumyushev
2008-09-30 11:47           ` Tejun Heo
2008-06-06 19:59 Zsiros Attila
2008-06-07  1:44 ` Oliver Pinter
2008-06-07  1:45   ` Oliver Pinter
2008-06-07  5:56   ` Andrew Morton
2008-06-07  8:47     ` Ilpo Järvinen
2008-06-07 12:50       ` Oliver Pinter
2008-06-07 15:09         ` Phil Oester
2008-06-07 18:53           ` Oliver Pinter
2008-06-08 11:56             ` Zsiros Attila
2008-06-09 17:04               ` Oliver Pinter
2006-07-09  2:04 BUG report Antonio Mignolli
2006-07-12 10:56 ` Markus Rechberger
2004-12-25 13:00 Bug report Ioannis Fikouras
2004-03-03 10:47 Manivannan Shanmugam
2002-10-04 15:01 bug report Sander Kamphuis
2002-10-04 15:32 ` Paulo Andre'
2002-10-04 15:35 ` Adrian Bunk
2002-04-24  9:15 Pan,Gaoyong
2001-11-27 15:04 Bug (?) report Matteo Sasso
2001-11-27 15:51 ` Tommy Reynolds
2001-11-10 19:01 Bug Report Logoth Dragon
2001-11-10 19:08 ` Alan Cox
2001-08-02  9:38 Bug report Daniel Glozman
2001-03-22 20:58 Craig Cummings
2001-03-22 21:43 ` Tim Walberg
2001-02-01 22:09 Anders S. Buch
2001-02-03  1:44 ` Jens Axboe

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=20020304160345Z292429-889+117297@vger.kernel.org \
    --to=vitaly@namesys.com \
    --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 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®