From 34ee649d7b1c62eb3e1fb0bfb0edb2903530f8e4 Mon Sep 17 00:00:00 2001 From: Tao Ma Date: Tue, 18 Aug 2009 11:44:07 +0800 Subject: [PATCH] --- yaml --- r: 165134 b: refs/heads/master c: c18b812d127a971901180188b918a7cd98ccd4d6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ocfs2/alloc.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 60502bf9c759..0331f2da3d75 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7540c1a77b26bc2f9d86a0bfbe6597b05ec5f93d +refs/heads/master: c18b812d127a971901180188b918a7cd98ccd4d6 diff --git a/trunk/fs/ocfs2/alloc.c b/trunk/fs/ocfs2/alloc.c index 7c879fc7834f..38a42f5d59ff 100644 --- a/trunk/fs/ocfs2/alloc.c +++ b/trunk/fs/ocfs2/alloc.c @@ -2326,10 +2326,18 @@ static int ocfs2_extend_rotate_transaction(handle_t *handle, int subtree_depth, int op_credits, struct ocfs2_path *path) { + int ret; int credits = (path->p_tree_depth - subtree_depth) * 2 + 1 + op_credits; - if (handle->h_buffer_credits < credits) - return ocfs2_extend_trans(handle, credits); + if (handle->h_buffer_credits < credits) { + ret = ocfs2_extend_trans(handle, + credits - handle->h_buffer_credits); + if (ret) + return ret; + + if (unlikely(handle->h_buffer_credits < credits)) + return ocfs2_extend_trans(handle, credits); + } return 0; }