From: Chris Mason <chris.mason@oracle.com>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: fix recursive auto-defrag
Date: Thu, 6 Oct 2011 11:53:34 -0400 [thread overview]
Message-ID: <20111006155334.GC5716@shiny.elevennetworks.com> (raw)
In-Reply-To: <4E8D230A.4040801@cn.fujitsu.com>
On Thu, Oct 06, 2011 at 11:39:54AM +0800, Li Zefan wrote:
> Follow those steps:
>
> # mount -o autodefrag /dev/sda7 /mnt
> # dd if=/dev/urandom of=/mnt/tmp bs=200K count=1
> # sync
> # dd if=/dev/urandom of=/mnt/tmp bs=8K count=1 conv=notrunc
>
> and then it'll go into a loop: writeback -> defrag -> writeback ...
>
> It's because writeback writes [8K, 200K] and then writes [0, 8K].
>
> I tried to make writeback know if the pages are dirtied by defrag,
> but the patch was a bit intrusive. Here I simply set writeback_index
> when we defrag a file.
Really nice and small fix. I'll definitely send this for 3.1
-chris
prev parent reply other threads:[~2011-10-06 15:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-06 3:39 [PATCH] Btrfs: fix recursive auto-defrag Li Zefan
2011-10-06 14:14 ` David Sterba
2011-10-06 15:53 ` Chris Mason [this message]
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=20111006155334.GC5716@shiny.elevennetworks.com \
--to=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=lizf@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.