diff options
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r-- | fs/gfs2/inode.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index b8956f24e3d3..890588c7fb33 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -604,6 +604,9 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, | |||
604 | error = PTR_ERR(inode); | 604 | error = PTR_ERR(inode); |
605 | if (!IS_ERR(inode)) { | 605 | if (!IS_ERR(inode)) { |
606 | d = d_splice_alias(inode, dentry); | 606 | d = d_splice_alias(inode, dentry); |
607 | error = PTR_ERR(d); | ||
608 | if (IS_ERR(d)) | ||
609 | goto fail_gunlock; | ||
607 | error = 0; | 610 | error = 0; |
608 | if (file) { | 611 | if (file) { |
609 | if (S_ISREG(inode->i_mode)) { | 612 | if (S_ISREG(inode->i_mode)) { |
@@ -799,6 +802,11 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry, | |||
799 | } | 802 | } |
800 | 803 | ||
801 | d = d_splice_alias(inode, dentry); | 804 | d = d_splice_alias(inode, dentry); |
805 | if (IS_ERR(d)) { | ||
806 | iput(inode); | ||
807 | gfs2_glock_dq_uninit(&gh); | ||
808 | return d; | ||
809 | } | ||
802 | if (file && S_ISREG(inode->i_mode)) | 810 | if (file && S_ISREG(inode->i_mode)) |
803 | error = finish_open(file, dentry, gfs2_open_common, opened); | 811 | error = finish_open(file, dentry, gfs2_open_common, opened); |
804 | 812 | ||