Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128818
b: refs/heads/master
c: a7a16fd
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent 67169a3 commit be65f36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f9efa9c784aa3b801feb367f72c6867d26fb348e
refs/heads/master: a7a16fd772620605c76e8ac8bdbc8ccc9e3df1a0
10 changes: 9 additions & 1 deletion trunk/fs/btrfs/root-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid,
struct btrfs_item *item;
struct btrfs_root_item *ri;
struct btrfs_key key;
struct btrfs_key found_key;
struct btrfs_path *path;
int ret;
u32 nritems;
Expand All @@ -166,6 +167,8 @@ int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid,
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;

again:
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
if (ret < 0)
goto err;
Expand Down Expand Up @@ -196,7 +199,11 @@ int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid,
if (btrfs_disk_root_refs(leaf, ri) != 0)
goto next;

dead_root = btrfs_read_fs_root_no_radix(root->fs_info, &key);
memcpy(&found_key, &key, sizeof(key));
key.offset++;
btrfs_release_path(root, path);
dead_root = btrfs_read_fs_root_no_radix(root->fs_info,
&found_key);
if (IS_ERR(dead_root)) {
ret = PTR_ERR(dead_root);
goto err;
Expand All @@ -206,6 +213,7 @@ int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid,
&root->fs_info->dead_roots);
if (ret)
goto err;
goto again;
next:
slot++;
path->slots[0]++;
Expand Down

0 comments on commit be65f36

Please sign in to comment.