diff options
Diffstat (limited to 'fs/btrfs/tree-defrag.c')
-rw-r--r-- | fs/btrfs/tree-defrag.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/btrfs/tree-defrag.c b/fs/btrfs/tree-defrag.c index b10eacdb1620..f7ac8e013ed7 100644 --- a/fs/btrfs/tree-defrag.c +++ b/fs/btrfs/tree-defrag.c | |||
@@ -117,13 +117,14 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans, | |||
117 | path->nodes[1], 0, | 117 | path->nodes[1], 0, |
118 | cache_only, &last_ret, | 118 | cache_only, &last_ret, |
119 | &root->defrag_progress); | 119 | &root->defrag_progress); |
120 | WARN_ON(ret && ret != -EAGAIN); | 120 | if (ret) { |
121 | WARN_ON(ret == -EAGAIN); | ||
122 | goto out; | ||
123 | } | ||
121 | if (next_key_ret == 0) { | 124 | if (next_key_ret == 0) { |
122 | memcpy(&root->defrag_progress, &key, sizeof(key)); | 125 | memcpy(&root->defrag_progress, &key, sizeof(key)); |
123 | ret = -EAGAIN; | 126 | ret = -EAGAIN; |
124 | } | 127 | } |
125 | |||
126 | btrfs_release_path(root, path); | ||
127 | out: | 128 | out: |
128 | if (path) | 129 | if (path) |
129 | btrfs_free_path(path); | 130 | btrfs_free_path(path); |