aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index e62e59477884..fc8ac2ee0667 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -626,8 +626,10 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
626 if (!IS_ERR(inode)) { 626 if (!IS_ERR(inode)) {
627 d = d_splice_alias(inode, dentry); 627 d = d_splice_alias(inode, dentry);
628 error = PTR_ERR(d); 628 error = PTR_ERR(d);
629 if (IS_ERR(d)) 629 if (IS_ERR(d)) {
630 inode = ERR_CAST(d);
630 goto fail_gunlock; 631 goto fail_gunlock;
632 }
631 error = 0; 633 error = 0;
632 if (file) { 634 if (file) {
633 if (S_ISREG(inode->i_mode)) { 635 if (S_ISREG(inode->i_mode)) {
@@ -840,8 +842,10 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry,
840 int error; 842 int error;
841 843
842 inode = gfs2_lookupi(dir, &dentry->d_name, 0); 844 inode = gfs2_lookupi(dir, &dentry->d_name, 0);
843 if (!inode) 845 if (inode == NULL) {
846 d_add(dentry, NULL);
844 return NULL; 847 return NULL;
848 }
845 if (IS_ERR(inode)) 849 if (IS_ERR(inode))
846 return ERR_CAST(inode); 850 return ERR_CAST(inode);
847 851
@@ -854,7 +858,6 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry,
854 858
855 d = d_splice_alias(inode, dentry); 859 d = d_splice_alias(inode, dentry);
856 if (IS_ERR(d)) { 860 if (IS_ERR(d)) {
857 iput(inode);
858 gfs2_glock_dq_uninit(&gh); 861 gfs2_glock_dq_uninit(&gh);
859 return d; 862 return d;
860 } 863 }