From: Martin Steigerwald <martin@lichtvoll.de>
To: "erpo41@gmail.com" <erpo41@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Defrag operations sometimes don't work.
Date: Sun, 12 Jul 2015 10:54:37 +0200 [thread overview]
Message-ID: <11405054.0T05W1bXEO@merkaba> (raw)
In-Reply-To: <CAPQXdDTT5E3f3VqAuQYKp3FwHjU45CfGW35du3HxRCHdyuz5gA@mail.gmail.com>
Am Samstag, 11. Juli 2015, 10:40:29 schrieb erpo41@gmail.com:
> On Sat, Jul 11, 2015 at 4:12 AM, Martin Steigerwald <martin@lichtvoll.de>
wrote:
> > Always do "sync" after a "btrfs fi defrag" and before measuring with
> > "filefrag". The kernel may not have written everything. I have seen this
> > repeatedly that the extent count drops further after a "sync", following
> > "btrfs fi defrag".
>
> First of all, thank you for your help. This fixed the problem for
> defragging individual files.
Note however: Even without "sync" BTRFS will defragment the file. It may
just take a while till the new extents are written. So there is no need to
call "sync" after btrfs fi defrag.
Why are you trying to defragment anyway? What are you trying to achieve /
solve?
> I'm now seeing that recursive defragging doesn't work the way I expect.
> Running
>
> $ btrfs fi defrag -r /path/to
>
> returns almost immediately and does not reduce the number of fragments
> in /path/to/file. However, running
>
> $ btrfs fi defrag /path/to/file
>
> does reduce the number of fragments.
Well, I have no idea about this one. I have the same behavior with
> >> btrfs --version: Btrfs v3.17
v4.0
Ciao,
--
Martin
next prev parent reply other threads:[~2015-07-12 8:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-11 1:12 Defrag operations sometimes don't work erpo41
2015-07-11 10:12 ` Martin Steigerwald
2015-07-11 16:40 ` erpo41
2015-07-12 8:54 ` Martin Steigerwald [this message]
2015-07-12 20:35 ` erpo41
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=11405054.0T05W1bXEO@merkaba \
--to=martin@lichtvoll.de \
--cc=erpo41@gmail.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).