linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: fdmanana@kernel.org
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/3] Fixes for races in relocation and avoid start and wait for unrelated IO
Date: Mon, 25 Apr 2016 02:01:09 +0100	[thread overview]
Message-ID: <1461546072-11154-1-git-send-email-fdmanana@kernel.org> (raw)

From: Filipe Manana <fdmanana@suse.com>

The following patches fix 2 hard to hit races in relocation that make its
first phase (MOVE_DATA_EXTENTS) miss extents, triggers a warning in the
second phase (UPDATE_DATA_PTRS) and leaves metadata in an invalid state
(file extent items pointing to areas corresponding to the deleted block
group), leading to a BUG_ON() when attempting to read those extents after
the relocation finishes.
Patches 1 and 3 fix those races, patch 2 is an optimization that makes
the relocation no longer wait for ordered extents against other groups
and patch 3 besides fixing a race also makes relocation only wait for
tasks that started delalloc flushing and allocated already an extent
from the block group we are relocating, instead of flushing all delalloc
regions.

Filipe Manana (3):
  Btrfs: fix race in relocation that makes us miss extents
  Btrfs: don't wait for unrelated IO to finish before relocation
  Btrfs: don't do unnecessary delalloc flushes when relocating

 fs/btrfs/ctree.h        | 14 ++++++++++
 fs/btrfs/dev-replace.c  |  4 +--
 fs/btrfs/extent-tree.c  | 69 ++++++++++++++++++++++++++++++++++++++++++++-----
 fs/btrfs/inode.c        |  8 ++++++
 fs/btrfs/ioctl.c        |  2 +-
 fs/btrfs/ordered-data.c | 30 ++++++++++++++++-----
 fs/btrfs/ordered-data.h |  6 +++--
 fs/btrfs/relocation.c   | 30 +++++++++++++++++----
 fs/btrfs/super.c        |  2 +-
 fs/btrfs/transaction.c  |  2 +-
 10 files changed, 142 insertions(+), 25 deletions(-)

-- 
2.7.0.rc3


             reply	other threads:[~2016-04-26 10:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25  1:01 fdmanana [this message]
2016-04-25  1:01 ` [PATCH 1/3] Btrfs: fix race in relocation that makes us miss extents fdmanana
2016-05-09 22:15   ` Liu Bo
2016-04-25  1:01 ` [PATCH 2/3] Btrfs: don't wait for unrelated IO to finish before relocation fdmanana
2016-05-09 22:59   ` Liu Bo
2016-04-25  1:01 ` [PATCH 3/3] Btrfs: don't do unnecessary delalloc flushes when relocating fdmanana
2016-05-09 23:56   ` Liu Bo
2016-05-10 10:22     ` Filipe Manana
2016-04-26 13:42 ` [PATCH 0/3] Fixes for races in relocation and avoid start and wait for unrelated IO Holger Hoffstätte
2016-04-26 14:23   ` Filipe Manana

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=1461546072-11154-1-git-send-email-fdmanana@kernel.org \
    --to=fdmanana@kernel.org \
    --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).