aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-01-04 09:34:54 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:59 -0400
commit1372f8e609d260c2352bf74e125614eef7aee8ef (patch)
treeb20a655957cb27a51779a9db971aeb8b9d9d2d19 /fs/btrfs/extent-tree.c
parent2552488345ea0933711010ee2c844792130a4252 (diff)
Properly call btrfs_search_slot while shrinking
The shrinking code used btrfs_next_leaf to find the next item, but this does not cow the blocks it touches. This fix calls search_slot after finding the next item to do appropriate cow and balancing. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 426a0222e12f..c390fd847a27 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2434,7 +2434,15 @@ bg_next:
2434 break; 2434 break;
2435 } 2435 }
2436 leaf = path->nodes[0]; 2436 leaf = path->nodes[0];
2437 nritems = btrfs_header_nritems(leaf); 2437 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
2438
2439 /*
2440 * btrfs_next_leaf doesn't cow buffers, we have to
2441 * do the search again
2442 */
2443 memcpy(&key, &found_key, sizeof(key));
2444 btrfs_release_path(root, path);
2445 continue;
2438 } 2446 }
2439 2447
2440 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); 2448 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);