linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: Filipe Manana <fdmanana@kernel.org>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	Filipe Manana <fdmanana@suse.com>, <stable@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: fix read corruption of compressed and shared extents
Date: Mon, 14 Sep 2015 08:50:44 -0400	[thread overview]
Message-ID: <20150914125044.GA11307@ret.masoncoding.com> (raw)
In-Reply-To: <55F6948A.4060203@cn.fujitsu.com>

On Mon, Sep 14, 2015 at 05:34:02PM +0800, Qu Wenruo wrote:
> >>And in your case:
> >>(With a little modification, decompressed length is 32K now)
> >>     File layout
> >>     [0 - 8K]                      [8K - 24K]
> >>         |                             |
> >>         |                             |
> >>      points to extent X,         points to extent X,
> >>      offset 4K, length of 8K     offset 0, length 16K
> >>
> >>     [extent X, compressed length = 4K uncompressed length = 32K]
> >>
> >>We want to read [4K,12K) and [0,16K) of uncompressed extent X,
> >>then the real needed max range will be [0,16K).
> >>
> >>So submit one bio to read the extent, then extract the first 16K.
> >>Then copy [4K,12K) into pages for first extent, and [0,16K) for 2nd.
> >>
> >>Any idea for such enhancement?
> >
> >Yes, but I really didn't like the complexity of such solution (I tried
> >something similar) and didn't saw any significant overhead in my
> >testing that justifies it.
> >
> >thanks
> 
> Right, I didn't take block layer into consideration.
> That's what block layer should do and it has already done it well.
> 
> So I'm completely OK with your fix, especially for your nice and clear
> comment in the code.

Yeah, I'd rather keep it simple until we have workloads that are hitting
a performance problem here.

-chris

  reply	other threads:[~2015-09-14 12:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-14  8:29 [PATCH] Btrfs: fix read corruption of compressed and shared extents fdmanana
2015-09-14  9:08 ` Qu Wenruo
2015-09-14  9:22   ` Filipe Manana
2015-09-14  9:34     ` Qu Wenruo
2015-09-14 12:50       ` Chris Mason [this message]
2015-09-15  8:09 ` Liu Bo

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=20150914125044.GA11307@ret.masoncoding.com \
    --to=clm@fb.com \
    --cc=fdmanana@kernel.org \
    --cc=fdmanana@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo@cn.fujitsu.com \
    --cc=stable@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).