linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Impossible case in btrfs self test?
Date: Wed, 10 Sep 2014 10:40:22 +0800	[thread overview]
Message-ID: <540FBA16.1010907@cn.fujitsu.com> (raw)

Hi, all

Btrfs self test seems to contain impossible case in it:
[0 - 5][5 -  6][6 - 10][10 - 4096]
[hole ][inline][ hole ][ regular ]

I really don't understand how such case can happen in real world.

If we create an inline extent, and punch hole inside inline extent, it 
will only zero out the
inline extents, but not to create a new small hole extent.

It is also strange that if we do write beyong the inline range and reach 4K,
then it will be converted to a normal extent, no more inline extent any 
more.

In fact, these test cases forces extent maps to handle unaligned extent.
However in fact, this will not happen except inlined file extent,
and regular/preallocated/hole file extents are all page size aligned.

Commit like the following could align to pagesize without problem if 
there is no
such self test.
Actually the commit will cause some bug if not aligned to page size. My 
fault again. :(
51f395ad4058883e4273b02fdebe98072dbdc0d2 btrfs: Use right extent length 
when inserting overlap extent map.

Should we change the inode-test self test?

Thanks,
Qu

                 reply	other threads:[~2014-09-10  2:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=540FBA16.1010907@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=linux-btrfs@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).