diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-06-25 22:01:31 +0200 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 17:04:04 +0200 |
commit | 1b1e2135dc1e4efbcf25ac9ac9979316d4e1193e (patch) | |
tree | 2af53ed5d4c368bbefd9de94f0adc2902a785468 /fs/btrfs/tree-defrag.c | |
parent | Btrfs: Change find_extent_buffer to use TestSetPageLocked (diff) | |
download | linux-1b1e2135dc1e4efbcf25ac9ac9979316d4e1193e.tar.xz linux-1b1e2135dc1e4efbcf25ac9ac9979316d4e1193e.zip |
Btrfs: Add a per-inode csum mutex to avoid races creating csum items
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/tree-defrag.c')
-rw-r--r-- | fs/btrfs/tree-defrag.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/tree-defrag.c b/fs/btrfs/tree-defrag.c index 1677e4edaf6f..b17693f61fbc 100644 --- a/fs/btrfs/tree-defrag.c +++ b/fs/btrfs/tree-defrag.c @@ -38,8 +38,15 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans, u64 last_ret = 0; if (root->fs_info->extent_root == root) { + /* + * there's recursion here right now in the tree locking, + * we can't defrag the extent root without deadlock + */ + goto out; +#if 0 mutex_lock(&root->fs_info->alloc_mutex); is_extent = 1; +#endif } if (root->ref_cows == 0 && !is_extent) |