|
@@ -604,6 +604,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)) {
|
|
@@ -799,6 +802,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 d;
|
|
|
+ }
|
|
|
if (file && S_ISREG(inode->i_mode))
|
|
|
error = finish_open(file, dentry, gfs2_open_common, opened);
|
|
|
|