linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: Chris Mason <clm@fb.com>, David Sterba <dsterba@suse.com>,
	Josef Bacik <jbacik@fb.com>, btrfs <linux-btrfs@vger.kernel.org>
Subject: About the behavior of inline extent
Date: Mon, 10 Apr 2017 11:27:55 +0800	[thread overview]
Message-ID: <f9dc56cc-720e-0df1-f6c7-790e93276ee0@cn.fujitsu.com> (raw)

Hi,

Recent btrfs/137 test case makes me wonder what's the designed behavior 
of btrfs inline data extent.

The current behavior in fact is quite a chaos.
We need a standard of how inline extent should behave.

1) max_inline limit
    The problem of current max_inline is, it's never clear what it is
    limiting.

    For example, we don't allow page sized inline extent if not
    compressed.
    But we allow page sized inline extent if it's compressed.
    Is it just limiting size after compression?
    What if we really want to limit size before compression?

2) inline extent condition
    Is inline extent allowed if we have following regular extent?

    For plain extent, prealloc can cause regular extent to co-exist with
    inlined one.
    While normal write will only convert inlined extent to regular one.

    While for compressed extent, it can co-exist with regular extent, by
    # xfs_io -f -c "pwrite 0 4k" -c sync -c "pwrite 4k 16k" /mnt/btrfs/file

    So which is the correct behavior?
    Personally I think we should not allow co-exist, as it's already
    causing a lot of fixes for it, that's to say neither current
    behavior is correct.

3) inline extent and fallocate
    For inline extent, as long as we are calling fallocate inside the
    page size, only the isize is expanded.

    Only beyond page size, we get prealloc extents.
    (However inlined extent is still here, not converted)

    What's the designed behavior? Convert inline to regular or just
    leave it as is?

Thanks,
Qu



             reply	other threads:[~2017-04-10  3:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10  3:27 Qu Wenruo [this message]
2017-04-10 14:17 ` About the behavior of inline extent Josef Bacik
2017-04-10 15:34   ` David Sterba
2017-04-11  2:20     ` Qu Wenruo
2017-04-11  2:27       ` Qu Wenruo

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=f9dc56cc-720e-0df1-f6c7-790e93276ee0@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=jbacik@fb.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).