aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dcache.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-05-02 16:30:47 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-05-02 16:30:47 -0700
commit7e567b44e6c59ad8bec321afb03302ffb1e6dda6 (patch)
treebd02466f931a471691db1da47d6d072924cfef1f /fs/ocfs2/dcache.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid (diff)
parentocfs2: Change repository in MAINTAINERS. (diff)
downloadlinux-dev-7e567b44e6c59ad8bec321afb03302ffb1e6dda6.tar.xz
linux-dev-7e567b44e6c59ad8bec321afb03302ffb1e6dda6.zip
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2: ocfs2: Change repository in MAINTAINERS. ocfs2: Fix a missing credit when deleting from indexed directories. ocfs2/trivial: Remove unused variable in ocfs2_rename. ocfs2: Add missing iput() during error handling in ocfs2_dentry_attach_lock() ocfs2: Fix some printk() warnings. ocfs2: Fix 2 warning during ocfs2 make. ocfs2: Reserve 1 more cluster in expanding_inline_dir for indexed dir.
Diffstat (limited to 'fs/ocfs2/dcache.c')
-rw-r--r--fs/ocfs2/dcache.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c
index 7d604480557a..b574431a031d 100644
--- a/fs/ocfs2/dcache.c
+++ b/fs/ocfs2/dcache.c
@@ -290,6 +290,21 @@ out_attach:
else
mlog_errno(ret);
+ /*
+ * In case of error, manually free the allocation and do the iput().
+ * We need to do this because error here means no d_instantiate(),
+ * which means iput() will not be called during dput(dentry).
+ */
+ if (ret < 0 && !alias) {
+ ocfs2_lock_res_free(&dl->dl_lockres);
+ BUG_ON(dl->dl_count != 1);
+ spin_lock(&dentry_attach_lock);
+ dentry->d_fsdata = NULL;
+ spin_unlock(&dentry_attach_lock);
+ kfree(dl);
+ iput(inode);
+ }
+
dput(alias);
return ret;