Commit 5902f4dd authored by Andreas Gruenbacher's avatar Andreas Gruenbacher
Browse files

gfs2: Don't return NULL from gfs2_inode_lookup



Callers expect gfs2_inode_lookup to return an inode pointer or ERR_PTR(error).
Commit b66648ad caused it to return NULL instead of ERR_PTR(-ESTALE) in
some cases.  Fix that.

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Fixes: b66648ad ("gfs2: Move inode generation number check into gfs2_inode_lookup")
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent 9ebcfadb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -207,10 +207,11 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,

	if (no_formal_ino && ip->i_no_formal_ino &&
	    no_formal_ino != ip->i_no_formal_ino) {
		error = -ESTALE;
		if (inode->i_state & I_NEW)
			goto fail;
		iput(inode);
		return ERR_PTR(-ESTALE);
		return ERR_PTR(error);
	}

	if (inode->i_state & I_NEW)