summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorYan Zheng <zheng.yan@oracle.com>2009-02-12 14:14:53 -0500
committerChris Mason <chris.mason@oracle.com>2009-02-12 14:14:53 -0500
commit2456242530a21cfee82646ebeeda65d3f74faa4c (patch)
treec0e8f5eda96cefeb44a48f05a248ea22b4259ad2 /fs/btrfs/extent-tree.c
parent4008c04a07c73ec3cb1be4c1391d2159a8f75d6d (diff)
downloadlinux-stable-2456242530a21cfee82646ebeeda65d3f74faa4c.tar.gz
linux-stable-2456242530a21cfee82646ebeeda65d3f74faa4c.tar.bz2
linux-stable-2456242530a21cfee82646ebeeda65d3f74faa4c.zip
Btrfs: hold trans_mutex when using btrfs_record_root_in_trans
btrfs_record_root_in_trans needs the trans_mutex held to make sure two callers don't race to setup the root in a given transaction. This adds it to all the places that were missing it. Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index cd86bffbdc9f..0a5d796c9f7e 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5658,7 +5658,9 @@ static noinline int relocate_one_extent(struct btrfs_root *extent_root,
prev_block = block_start;
}
+ mutex_lock(&extent_root->fs_info->trans_mutex);
btrfs_record_root_in_trans(found_root);
+ mutex_unlock(&extent_root->fs_info->trans_mutex);
if (ref_path->owner_objectid >= BTRFS_FIRST_FREE_OBJECTID) {
/*
* try to update data extent references while