提交 bd09835d 编写于 作者: C Chris Mason

count_snapshots: Properly update the leaf pointer after btrfs_next_leaf

Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 98ed5174
...@@ -693,7 +693,6 @@ u32 btrfs_count_snapshots_in_path(struct btrfs_root *root, ...@@ -693,7 +693,6 @@ u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
u64 root_objectid = root->root_key.objectid; u64 root_objectid = root->root_key.objectid;
u32 total_count = 0; u32 total_count = 0;
u32 cur_count; u32 cur_count;
u32 refs;
u32 nritems; u32 nritems;
int ret; int ret;
struct btrfs_key key; struct btrfs_key key;
...@@ -729,8 +728,8 @@ u32 btrfs_count_snapshots_in_path(struct btrfs_root *root, ...@@ -729,8 +728,8 @@ u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
} }
item = btrfs_item_ptr(l, path->slots[0], struct btrfs_extent_item); item = btrfs_item_ptr(l, path->slots[0], struct btrfs_extent_item);
refs = btrfs_extent_refs(l, item);
while (1) { while (1) {
l = path->nodes[0];
nritems = btrfs_header_nritems(l); nritems = btrfs_header_nritems(l);
if (path->slots[0] >= nritems) { if (path->slots[0] >= nritems) {
ret = btrfs_next_leaf(extent_root, path); ret = btrfs_next_leaf(extent_root, path);
...@@ -741,6 +740,7 @@ u32 btrfs_count_snapshots_in_path(struct btrfs_root *root, ...@@ -741,6 +740,7 @@ u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
btrfs_item_key_to_cpu(l, &found_key, path->slots[0]); btrfs_item_key_to_cpu(l, &found_key, path->slots[0]);
if (found_key.objectid != bytenr) if (found_key.objectid != bytenr)
break; break;
if (found_key.type != BTRFS_EXTENT_REF_KEY) { if (found_key.type != BTRFS_EXTENT_REF_KEY) {
path->slots[0]++; path->slots[0]++;
continue; continue;
......
...@@ -208,7 +208,7 @@ static int run_delalloc_nocow(struct inode *inode, u64 start, u64 end) ...@@ -208,7 +208,7 @@ static int run_delalloc_nocow(struct inode *inode, u64 start, u64 end)
} }
start = extent_end; start = extent_end;
} else if (found_type == BTRFS_FILE_EXTENT_INLINE) { } else {
goto not_found; goto not_found;
} }
loop: loop:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册