diff options
author | Josef Bacik <jbacik@fb.com> | 2014-03-28 00:41:34 +0100 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-04-07 02:34:36 +0200 |
commit | 573a075567f0174551e2fad2a3164afd2af788f2 (patch) | |
tree | 3712e14e91391f6a4d2b727e776d6879655067d3 /fs/btrfs/extent-tree.c | |
parent | Btrfs: do not reset last_snapshot after relocation (diff) | |
download | linux-573a075567f0174551e2fad2a3164afd2af788f2.tar.xz linux-573a075567f0174551e2fad2a3164afd2af788f2.zip |
Btrfs: check for an extent_op on the locked ref
We could have possibly added an extent_op to the locked_ref while we dropped
locked_ref->lock, so check for this case as well and loop around. Otherwise we
could lose flag updates which would lead to extent tree corruption. Thanks,
cc: stable@vger.kernel.org
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to '')
-rw-r--r-- | fs/btrfs/extent-tree.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index c6b6a6e3e735..e09db2c2f3b4 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -2444,7 +2444,8 @@ static noinline int __btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, spin_unlock(&locked_ref->lock); spin_lock(&delayed_refs->lock); spin_lock(&locked_ref->lock); - if (rb_first(&locked_ref->ref_root)) { + if (rb_first(&locked_ref->ref_root) || + locked_ref->extent_op) { spin_unlock(&locked_ref->lock); spin_unlock(&delayed_refs->lock); continue; |