linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Greenslade <sean@seangreenslade.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: Chris Murphy <lists@colorremedies.com>,
	David Sterba <dsterba@suse.cz>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Post ext3 conversion problems
Date: Mon, 19 Sep 2016 23:39:34 -0400	[thread overview]
Message-ID: <20160920033933.GA13425@coach.home> (raw)
In-Reply-To: <5f07d365-1eec-7f90-7969-af761834ee48@cn.fujitsu.com>

On Tue, Sep 20, 2016 at 10:49:42AM +0800, Qu Wenruo wrote:
> OK, I see the problem now.
> 
> The new convert is designed to create minimal number of extents, so it
> result the following file extents layout:
> 
> Ext2_save/image
>         |
> /-------------------------------\
> |           Extent A             |
> |<---Old Ext3 Used space  ------>|<--- Free space--->|
>       \---/\---/\---/
>         |    |    |
>        F1    F2   F3
> 
> This causes a large extent A, refered by ext2_save/image, and files like
> F1/2/3 just refer to part of the large extent A.
> 
> After removing the whole ext2_save subvolume, Extent A is still there, since
> F1/2/3 are still referring it.
> 
> |<---Old Ext3 Used space  ------>|<--- Free space--->|
> |           Extent A             |
>       \---/\---/\---/
>         |    |    |
>        F1    F2   F3
> 
> 
> 
> In that case, not balance but defrag is responsible to "split" the large
> extent and free the unused space.
> 
> However btrfs defrag doesn't work for case like subvolume or reflink for a
> long time, which leaves the extent layout unchanged.
> And balance doesn't handle it, as balance just relocated the large extent A
> and modify all referencers' pointer.
> 
> Sigh, I just forgot the fact that defrag doesn't work for a long time when
> designing the new convert.
> 
> So, we still need a working kernel defrag to make the fs to  be a "native"
> btrfs.
> 
> 
> However, such layout is completely valid for btrfs, one can generate it
> quite easily which following script:
> ----
> xfs_io -f -c "pwrite 0 16M" $mnt/orig
> for i in $(seq 0 15); do
> 	xfs_io -f -c "reflink $mnt/orig ${i}M 0 1M" $mnt/file${i}
> done
> ----
> 
> So there is still something wrong in your backtrace so that we need to dig
> further.
> 
> Any idea of your load pattern to trigger the bug?

Glad to hear you've found the core of the issue.

At this point, I can trigger it immediately. As soon as I log in and run
dmenu, it will attempt to rebuild its cache file (small text file that's
just a list of all executables in the PATH). Once that write happens,
the bug triggers and the fs goes read only.

--Sean


  reply	other threads:[~2016-09-20  3:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16 19:25 Post ext3 conversion problems Sean Greenslade
2016-09-16 20:23 ` Chris Murphy
2016-09-16 23:25   ` Sean Greenslade
2016-09-16 23:45     ` Chris Murphy
2016-09-17  0:03       ` Sean Greenslade
2016-09-19  2:20   ` Qu Wenruo
2016-09-19  4:12     ` Sean Greenslade
2016-09-19  6:30       ` Qu Wenruo
2016-09-19 15:13         ` Sean Greenslade
2016-09-20  2:49           ` Qu Wenruo
2016-09-20  3:39             ` Sean Greenslade [this message]
2016-09-20  5:02               ` Qu Wenruo
2016-09-20 20:51                 ` Sean Greenslade
2016-09-26  2:16                   ` Sean Greenslade
2016-09-26  2:37                     ` Qu Wenruo
2016-09-17  2:27 ` Liu Bo
2016-09-17  4:16   ` Sean Greenslade

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=20160920033933.GA13425@coach.home \
    --to=sean@seangreenslade.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.com \
    --cc=quwenruo@cn.fujitsu.com \
    /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).