linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Potential bug in fs/ext4/inline.c?
Date: Fri, 22 Aug 2014 15:29:12 +0800	[thread overview]
Message-ID: <20140822072912.GA4042@gmail.com> (raw)
In-Reply-To: <20140821220126.GA3597@thunk.org>

On Thu, Aug 21, 2014 at 06:01:26PM -0400, Theodore Ts'o wrote:
> In ext4_find_inline_entry(), there is the following:
> 
> 	if (ext4_get_inline_size(dir) == EXT4_MIN_INLINE_DATA_SIZE)
> 		goto out;
> 
> Am I missing something, or shouldn't this be:
> 
> 	if (ext4_get_inline_size(dir) <= EXT4_MIN_INLINE_DATA_SIZE)
> 		goto out;

Hi Ted,

The original design idea is that the size of inline data shouldn't be
less than EXT4_MIN_INLINE_DATA_SIZE (60 bytes).  That means that the
inline data will occupy the whole i_block[] space.

If we create a new dir with inline data feature, the disk layout will
looks like below (ext4_try_create_inline_dir()):

i_block[0]: parent ino (4 bytes)
i_block+4:  dir entry (ino 0, rec_len 56 bytes)

Regards,
                                                - Zheng

      parent reply	other threads:[~2014-08-22  7:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 22:01 Potential bug in fs/ext4/inline.c? Theodore Ts'o
2014-08-22  4:02 ` Darrick J. Wong
2014-08-22  7:29 ` Zheng Liu [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=20140822072912.GA4042@gmail.com \
    --to=gnehzuil.liu@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).