diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/backref.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 6a3f7f50ad37..835b6c9a26a8 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c | |||
@@ -1569,7 +1569,6 @@ static int iterate_inode_refs(u64 inum, struct btrfs_root *fs_root, | |||
1569 | struct btrfs_key found_key; | 1569 | struct btrfs_key found_key; |
1570 | 1570 | ||
1571 | while (!ret) { | 1571 | while (!ret) { |
1572 | path->leave_spinning = 1; | ||
1573 | ret = inode_ref_info(inum, parent ? parent+1 : 0, fs_root, path, | 1572 | ret = inode_ref_info(inum, parent ? parent+1 : 0, fs_root, path, |
1574 | &found_key); | 1573 | &found_key); |
1575 | if (ret < 0) | 1574 | if (ret < 0) |
@@ -1582,9 +1581,12 @@ static int iterate_inode_refs(u64 inum, struct btrfs_root *fs_root, | |||
1582 | 1581 | ||
1583 | parent = found_key.offset; | 1582 | parent = found_key.offset; |
1584 | slot = path->slots[0]; | 1583 | slot = path->slots[0]; |
1585 | eb = path->nodes[0]; | 1584 | eb = btrfs_clone_extent_buffer(path->nodes[0]); |
1586 | /* make sure we can use eb after releasing the path */ | 1585 | if (!eb) { |
1587 | atomic_inc(&eb->refs); | 1586 | ret = -ENOMEM; |
1587 | break; | ||
1588 | } | ||
1589 | extent_buffer_get(eb); | ||
1588 | btrfs_tree_read_lock(eb); | 1590 | btrfs_tree_read_lock(eb); |
1589 | btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); | 1591 | btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); |
1590 | btrfs_release_path(path); | 1592 | btrfs_release_path(path); |
@@ -1642,9 +1644,12 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root, | |||
1642 | ++found; | 1644 | ++found; |
1643 | 1645 | ||
1644 | slot = path->slots[0]; | 1646 | slot = path->slots[0]; |
1645 | eb = path->nodes[0]; | 1647 | eb = btrfs_clone_extent_buffer(path->nodes[0]); |
1646 | /* make sure we can use eb after releasing the path */ | 1648 | if (!eb) { |
1647 | atomic_inc(&eb->refs); | 1649 | ret = -ENOMEM; |
1650 | break; | ||
1651 | } | ||
1652 | extent_buffer_get(eb); | ||
1648 | 1653 | ||
1649 | btrfs_tree_read_lock(eb); | 1654 | btrfs_tree_read_lock(eb); |
1650 | btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); | 1655 | btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); |