public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@clusterfs.com>
To: Mark Knibbs <markk@clara.co.uk>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Possible ext2 bug with large sparse files?
Date: Thu, 7 Jun 2007 11:51:55 -0600	[thread overview]
Message-ID: <20070607175154.GM5181@schatzie.adilger.int> (raw)
In-Reply-To: <E1HvvOu-000Ok2-Fh@oceanus.uk.clara.net>

On Jun 06, 2007  14:18 +0100, Mark Knibbs wrote:
> This is a follow-up to my previous message. The bug is also present in 
> ext3, and applies to partitions with 2K blocks and (at least in part) to 
> those with 4K blocks. There is also another issue, which may well be a bug 
> in e2fsck. 

Could you please clarify what the particular defect is that you are looking
at?  Presumably it is not just that there is an upper limit on the size of
a file?

> For partitions with 2K blocks the maximum file size is 275,415,851,008 
> bytes; changing the seek= argument in the dd examples to 275415851007 & 
> 275415851008 gives similar results. 
> 
> The maximum file size on partitions with 4K blocks is 2,196,875,759,616 
> bytes, so I tested using dd with seek=2196875759615 & 2196875759616. With 
> 4K blocks there don't seem to be any problems with warnings in dmesg 
> output, or fsck. The only bug (or what I think is a bug) is that
> dd if=/dev/zero of=test.bin bs=1 count=1 seek=2196875759616
> causes the file size to show as 2196875759616, but it shouldn't since no 
> actual write took place. 

The reason for this limitation is due to indirect block limits in the
ext2/3 file layout.  In ext4 it is theoretically possible to have files
up to 2^60 bytes in size, because the extent format handles 2^48-bit
block numbers, and the inode has an extra 16 bits to store the high part
of the block count.

> If instead you do
> dd if=/dev/zero of=test.bin bs=1 count=1 seek=17247252479
> (which should work okay, since the maximum file size is 17247252480) then 
> fsck -f gives a strange message:
> "Inode 6073, i_size is 17247252480, should be 17247252480.  Fix<y>?"
> Even if you say yes to "fix" it, repeatedly running fsck always asks that 
> question. 

This is definitely a bug...

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

  reply	other threads:[~2007-06-07 17:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06 13:18 Possible ext2 bug with large sparse files? Mark Knibbs
2007-06-07 17:51 ` Andreas Dilger [this message]
2007-06-07 21:40   ` Mark Knibbs
  -- strict thread matches above, loose matches on Subject: below --
2007-06-05 12:25 Mark Knibbs
2007-06-05 13:56 ` Theodore Tso

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=20070607175154.GM5181@schatzie.adilger.int \
    --to=adilger@clusterfs.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=markk@clara.co.uk \
    /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