public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: s-jaschke@t-online.de (Stefan Jaschke)
To: Jens Axboe <axboe@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Problems with Toshiba SD-W2002 DVD-RAM drive (IDE)
Date: Sat, 21 Apr 2001 18:47:07 +0200	[thread overview]
Message-ID: <01042118470700.01914@antares> (raw)
In-Reply-To: <01041714250400.01376@antares> <01041914440701.01232@antares> <20010419150332.B22159@suse.de>
In-Reply-To: <20010419150332.B22159@suse.de>

Hi Jens,

I took some time to try to understand why "mke2fs -b 2048 /dev/hdc"
wants 500MB memory. Here is a first explanation:
# mke2fs -m 0 -n /dev/hdc
mke2fs 1.19, 13-Jul-2000 for EXT2 FS 0.5b, 95/08/09
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
406650880 inodes, 813284544 blocks
0 blocks (0.00%) reserved for the super user
First data block=0
24820 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group

813284544 4k blocks would be 3.7 Terabyte.
(Strangely enough, calling mke2fs with any blocksize parameter results in a memory
allocation larger then my memory available.)

I took some more time to understand at what point the wrong size is introduced.
I got the source rpm, set CFLAGS to "-g", ran gdb, and nailed down the point:

(gdb) l
80      #endif
81              if (fd < 0)
82                      return errno;
83
84      #ifdef BLKGETSIZE
85              if (ioctl(fd, BLKGETSIZE, &size) >= 0) {
86                      close(fd);
87                      *retblocks = size / (blocksize / 512);
88                      return 0;
89              }
(gdb) n
86                      close(fd);
(gdb) print size
$1 = -2083658236
(gdb) bt
#0  ext2fs_get_device_size (file=0xbffff911 "/dev/hdc", blocksize=1024, 
    retblocks=0xbffff534) at ../../../lib/ext2fs/getsize.c:86
#1  0x804aca3 in PRS (argc=4, argv=0xbffff75c) at ../../misc/mke2fs.c:993
#2  0x804af2e in main (argc=4, argv=0xbffff75c) at ../../misc/mke2fs.c:1081
#3  0x40044baf in __libc_start_main () from /lib/libc.so.6
 
I am afraid I'd need help to go deeper.

Cheers,
Stefan J.

-- 
Stefan R. Jaschke <stefan@jaschke-net.de>
http://www.jaschke-net.de

      parent reply	other threads:[~2001-04-21 16:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-17 12:25 Problems with Toshiba SD-W2002 DVD-RAM drive (IDE) Stefan Jaschke
2001-04-18 10:39 ` Jens Axboe
2001-04-18 12:39   ` Jens Axboe
2001-04-18 22:12     ` Stefan Jaschke
2001-04-19 11:39     ` Stefan Jaschke
2001-04-19 11:46       ` Jens Axboe
2001-04-19 12:13         ` Stefan Jaschke
2001-04-19 12:15           ` Jens Axboe
2001-04-19 12:44             ` Stefan Jaschke
2001-04-19 13:03               ` Jens Axboe
2001-04-19 21:11                 ` Stefan Jaschke
2001-04-21 16:47                 ` Stefan Jaschke [this message]

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=01042118470700.01914@antares \
    --to=s-jaschke@t-online.de \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefan@jaschke-net.de \
    /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