aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/alloc.c')
-rw-r--r--fs/ocfs2/alloc.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index bf806e58b1cb..370b4ea4c23a 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -4332,17 +4332,17 @@ ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
4332 } else if (path->p_tree_depth > 0) { 4332 } else if (path->p_tree_depth > 0) {
4333 status = ocfs2_find_cpos_for_left_leaf(sb, path, &left_cpos); 4333 status = ocfs2_find_cpos_for_left_leaf(sb, path, &left_cpos);
4334 if (status) 4334 if (status)
4335 goto out; 4335 goto exit;
4336 4336
4337 if (left_cpos != 0) { 4337 if (left_cpos != 0) {
4338 left_path = ocfs2_new_path_from_path(path); 4338 left_path = ocfs2_new_path_from_path(path);
4339 if (!left_path) 4339 if (!left_path)
4340 goto out; 4340 goto exit;
4341 4341
4342 status = ocfs2_find_path(et->et_ci, left_path, 4342 status = ocfs2_find_path(et->et_ci, left_path,
4343 left_cpos); 4343 left_cpos);
4344 if (status) 4344 if (status)
4345 goto out; 4345 goto free_left_path;
4346 4346
4347 new_el = path_leaf_el(left_path); 4347 new_el = path_leaf_el(left_path);
4348 4348
@@ -4359,7 +4359,7 @@ ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
4359 le16_to_cpu(new_el->l_next_free_rec), 4359 le16_to_cpu(new_el->l_next_free_rec),
4360 le16_to_cpu(new_el->l_count)); 4360 le16_to_cpu(new_el->l_count));
4361 status = -EINVAL; 4361 status = -EINVAL;
4362 goto out; 4362 goto free_left_path;
4363 } 4363 }
4364 rec = &new_el->l_recs[ 4364 rec = &new_el->l_recs[
4365 le16_to_cpu(new_el->l_next_free_rec) - 1]; 4365 le16_to_cpu(new_el->l_next_free_rec) - 1];
@@ -4386,18 +4386,18 @@ ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
4386 path->p_tree_depth > 0) { 4386 path->p_tree_depth > 0) {
4387 status = ocfs2_find_cpos_for_right_leaf(sb, path, &right_cpos); 4387 status = ocfs2_find_cpos_for_right_leaf(sb, path, &right_cpos);
4388 if (status) 4388 if (status)
4389 goto out; 4389 goto free_left_path;
4390 4390
4391 if (right_cpos == 0) 4391 if (right_cpos == 0)
4392 goto out; 4392 goto free_left_path;
4393 4393
4394 right_path = ocfs2_new_path_from_path(path); 4394 right_path = ocfs2_new_path_from_path(path);
4395 if (!right_path) 4395 if (!right_path)
4396 goto out; 4396 goto free_left_path;
4397 4397
4398 status = ocfs2_find_path(et->et_ci, right_path, right_cpos); 4398 status = ocfs2_find_path(et->et_ci, right_path, right_cpos);
4399 if (status) 4399 if (status)
4400 goto out; 4400 goto free_right_path;
4401 4401
4402 new_el = path_leaf_el(right_path); 4402 new_el = path_leaf_el(right_path);
4403 rec = &new_el->l_recs[0]; 4403 rec = &new_el->l_recs[0];
@@ -4411,7 +4411,7 @@ ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
4411 (unsigned long long)le64_to_cpu(eb->h_blkno), 4411 (unsigned long long)le64_to_cpu(eb->h_blkno),
4412 le16_to_cpu(new_el->l_next_free_rec)); 4412 le16_to_cpu(new_el->l_next_free_rec));
4413 status = -EINVAL; 4413 status = -EINVAL;
4414 goto out; 4414 goto free_right_path;
4415 } 4415 }
4416 rec = &new_el->l_recs[1]; 4416 rec = &new_el->l_recs[1];
4417 } 4417 }
@@ -4428,9 +4428,11 @@ ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
4428 ret = contig_type; 4428 ret = contig_type;
4429 } 4429 }
4430 4430
4431out: 4431free_right_path:
4432 ocfs2_free_path(left_path);
4433 ocfs2_free_path(right_path); 4432 ocfs2_free_path(right_path);
4433free_left_path:
4434 ocfs2_free_path(left_path);
4435exit:
4434 return ret; 4436 return ret;
4435} 4437}
4436 4438