Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144389
b: refs/heads/master
c: a5a0a63
h: refs/heads/master
i:
  144387: a603ae9
v: v3
  • Loading branch information
Sunil Mushran authored and Joel Becker committed Apr 23, 2009
1 parent 89d83a2 commit b783188
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5b09b507daaa882d888b6cd78ee89ba9caace44b
refs/heads/master: a5a0a630922a2f6a774b6dac19f70cb5abd86bb0
15 changes: 15 additions & 0 deletions trunk/fs/ocfs2/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,21 @@ int ocfs2_dentry_attach_lock(struct dentry *dentry,
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;
Expand Down

0 comments on commit b783188

Please sign in to comment.