diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/alloc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 7c879fc7834f..38a42f5d59ff 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -2326,10 +2326,18 @@ static int ocfs2_extend_rotate_transaction(handle_t *handle, int subtree_depth, | |||
2326 | int op_credits, | 2326 | int op_credits, |
2327 | struct ocfs2_path *path) | 2327 | struct ocfs2_path *path) |
2328 | { | 2328 | { |
2329 | int ret; | ||
2329 | int credits = (path->p_tree_depth - subtree_depth) * 2 + 1 + op_credits; | 2330 | int credits = (path->p_tree_depth - subtree_depth) * 2 + 1 + op_credits; |
2330 | 2331 | ||
2331 | if (handle->h_buffer_credits < credits) | 2332 | if (handle->h_buffer_credits < credits) { |
2332 | return ocfs2_extend_trans(handle, credits); | 2333 | ret = ocfs2_extend_trans(handle, |
2334 | credits - handle->h_buffer_credits); | ||
2335 | if (ret) | ||
2336 | return ret; | ||
2337 | |||
2338 | if (unlikely(handle->h_buffer_credits < credits)) | ||
2339 | return ocfs2_extend_trans(handle, credits); | ||
2340 | } | ||
2333 | 2341 | ||
2334 | return 0; | 2342 | return 0; |
2335 | } | 2343 | } |