diff options
| author | Takashi Iwai <tiwai@suse.de> | 2009-05-12 11:57:09 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2009-05-12 11:57:09 +0200 |
| commit | ddc4097b77bbb227851a44287acb2fb8a9896cc1 (patch) | |
| tree | 319d098879bed7c45543d983de8becd509701b22 /fs/ocfs2/dcache.c | |
| parent | bec4c99e8637b5b8bd4b0513eacb51da25885e3b (diff) | |
| parent | ae31c1fbdbb18d917b0a1139497c2dbd35886989 (diff) | |
Merge branch 'topic/drvdata-fix' into topic/asoc
Diffstat (limited to 'fs/ocfs2/dcache.c')
| -rw-r--r-- | fs/ocfs2/dcache.c | 15 |
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; |
