From: Theodore Ts'o <tytso@mit.edu>
To: Felipe Monteiro de Carvalho <felipemonteiro.carvalho@gmail.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Too large value in inode.i_blocks[1]
Date: Wed, 12 Jun 2013 08:59:54 -0400 [thread overview]
Message-ID: <20130612125954.GB26388@thunk.org> (raw)
In-Reply-To: <loom.20130612T065900-326@post.gmane.org>
On Wed, Jun 12, 2013 at 05:08:21AM +0000, Felipe Monteiro de Carvalho wrote:
>
> Continuing in my adventures with ext4, now I am having
> a problem that when reading the root
> inode everything is fine.
> When reading the inodes of directories placed on the file system root,
> my reading fails, because inode.i_blocks has the following data
> (for 1 particular subdir for example):
>
> 127754,
> 4,
> 0,
> 0,
> 1,
> 1366,
> 0,...
>
> The root works because in its inode i_blocks[1] has a smaller,
> in-bounds value, but this one has
> the first value completely out of bounds of the filesystem =(
>
> My ext4 filesystem has 3 incompat flags set: EXT4_FEATURE_INCOMPAT_FILETYPE,
> EXT4_FEATURE_INCOMPAT_EXTENTS, EXT4_FEATURE_INCOMPAT_FLEX_BG
The inode in question has the EXTENTS_FL flag set, which means the
i_blocks[] array needs to get interpreted as the root node of the
extent tree. 127754 is 0x0001F30A, where F30A is the magic number for
the extents header, and 0x0001 means there is a single entry in the
extent node.
I **strongly** discourage people from trying to access the file system
directly. It's much better to use the libext2fs library, since it
will deal with these sorts of issues for you automatically. A
program, even one written years ago, which uses the block iterator, or
the directory iterator, or the namei function, or the
ext2fs_file_{open,read,write,llseek}() functions provided by
libext2fs, would have continued working when ext4 appeared, since we
added ext4 support to the libext2fs library in such a way that older
programs would continue working just fine.
A good example of such a user of libext2fs is the e2tools userspace
package.
Regards,
- Ted
next prev parent reply other threads:[~2013-06-12 12:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-12 5:08 Too large value in inode.i_blocks[1] Felipe Monteiro de Carvalho
2013-06-12 12:59 ` Theodore Ts'o [this message]
2013-06-12 13:34 ` Felipe Monteiro de Carvalho
2013-06-12 13:52 ` Theodore Ts'o
2013-06-12 14:25 ` Eric Sandeen
2013-07-01 15:15 ` Felipe Monteiro de Carvalho
2013-07-01 17:02 ` Theodore Ts'o
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=20130612125954.GB26388@thunk.org \
--to=tytso@mit.edu \
--cc=felipemonteiro.carvalho@gmail.com \
--cc=linux-ext4@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;
as well as URLs for NNTP newsgroup(s).