diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2009-02-12 20:14:53 +0100 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-02-12 20:14:53 +0100 |
commit | 2456242530a21cfee82646ebeeda65d3f74faa4c (patch) | |
tree | c0e8f5eda96cefeb44a48f05a248ea22b4259ad2 /fs/btrfs/tree-log.c | |
parent | Btrfs: make a lockdep class for the extent buffer locks (diff) | |
download | linux-2456242530a21cfee82646ebeeda65d3f74faa4c.tar.xz linux-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/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 20794290256b..9c462fbd60fa 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -2832,7 +2832,9 @@ again: BUG_ON(!wc.replay_dest); wc.replay_dest->log_root = log; + mutex_lock(&fs_info->trans_mutex); btrfs_record_root_in_trans(wc.replay_dest); + mutex_unlock(&fs_info->trans_mutex); ret = walk_log_tree(trans, log, &wc); BUG_ON(ret); |