Message ID | 20140116164411.GD16829@fieldses.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
----- Original Message ----- | Something like this? (snip) | @@ -779,6 +782,11 @@ static struct dentry *__gfs2_lookup(struct inode *dir, | struct dentry *dentry, | } | | d = d_splice_alias(inode, dentry); | + if (IS_ERR(d)) { | + iput(inode); | + gfs2_glock_dq_uninit(&gh); | + return ERR_PTR(error); ---------------------------------^ Shouldn't that be ERR_PTR(d)? Bob Peterson Red Hat File Systems -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 7119504..19e0924 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -585,6 +585,9 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, error = PTR_ERR(inode); if (!IS_ERR(inode)) { d = d_splice_alias(inode, dentry); + error = PTR_ERR(d); + if (IS_ERR(d)) + goto fail_gunlock; error = 0; if (file) { if (S_ISREG(inode->i_mode)) { @@ -779,6 +782,11 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry, } d = d_splice_alias(inode, dentry); + if (IS_ERR(d)) { + iput(inode); + gfs2_glock_dq_uninit(&gh); + return ERR_PTR(error); + } if (file && S_ISREG(inode->i_mode)) error = finish_open(file, dentry, gfs2_open_common, opened);