diff --git a/[refs] b/[refs] index 6db748b47a82..75f3d552562e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 62dbd7176e196cd042c5542696981b268264fe92 +refs/heads/master: 0a3896d0f563d4472c75ab2c26afd8940d24b5a1 diff --git a/trunk/fs/btrfs/extent-tree.c b/trunk/fs/btrfs/extent-tree.c index 8464d369e478..fa57965f60a3 100644 --- a/trunk/fs/btrfs/extent-tree.c +++ b/trunk/fs/btrfs/extent-tree.c @@ -419,8 +419,7 @@ static noinline void caching_thread(struct btrfs_work *work) if (ret) break; - if (need_resched() || - btrfs_next_leaf(extent_root, path)) { + if (need_resched()) { caching_ctl->progress = last; btrfs_release_path(path); up_read(&fs_info->extent_commit_sem); @@ -428,6 +427,12 @@ static noinline void caching_thread(struct btrfs_work *work) cond_resched(); goto again; } + + ret = btrfs_next_leaf(extent_root, path); + if (ret < 0) + goto err; + if (ret) + break; leaf = path->nodes[0]; nritems = btrfs_header_nritems(leaf); continue;