From 4824755201e85b5aa5130005f12a24aee4692675 Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Wed, 9 May 2007 17:34:26 -0700 Subject: [PATCH] --- yaml --- r: 56999 b: refs/heads/master c: 8fccfc829a66b8b879c6672940523a402a786ce1 h: refs/heads/master i: 56997: 9150bb3904775a63d7fdbaca5178c21a6b49a49b 56995: cbe8df51b0f87a69d20fdc9864e68f397a5944fc 56991: 06608c677c2f739a5cd9f574a46fc8bd65d8dd32 v: v3 --- [refs] | 2 +- trunk/fs/ocfs2/localalloc.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 96770bfc89e8..97b01e420c83 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5c3c6bb7709bf2bf4132750124879b3d89183e46 +refs/heads/master: 8fccfc829a66b8b879c6672940523a402a786ce1 diff --git a/trunk/fs/ocfs2/localalloc.c b/trunk/fs/ocfs2/localalloc.c index 4dedd9789108..545f7892cdf3 100644 --- a/trunk/fs/ocfs2/localalloc.c +++ b/trunk/fs/ocfs2/localalloc.c @@ -471,9 +471,6 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb, mutex_lock(&local_alloc_inode->i_mutex); - ac->ac_inode = local_alloc_inode; - ac->ac_which = OCFS2_AC_USE_LOCAL; - if (osb->local_alloc_state != OCFS2_LA_ENABLED) { status = -ENOSPC; goto bail; @@ -511,10 +508,14 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb, } } + ac->ac_inode = local_alloc_inode; + ac->ac_which = OCFS2_AC_USE_LOCAL; get_bh(osb->local_alloc_bh); ac->ac_bh = osb->local_alloc_bh; status = 0; bail: + if (status < 0 && local_alloc_inode) + iput(local_alloc_inode); mlog_exit(status); return status;