Skip to content

Commit b8e12e3

Browse files
author
Andreas Gruenbacher
committed
gfs2: gfs2_inode_lookup cleanup
In gfs2_inode_lookup, once the inode has been looked up, we check if the inode generation (no_formal_ino) is the one we're looking for. If it isn't and the inode wasn't in the inode cache, we discard the newly looked up inode. This is unnecessary, complicates the code, and makes future changes to gfs2_inode_lookup harder, so change the code to retain newly looked up inodes instead. Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent e11b02d commit b8e12e3

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

fs/gfs2/inode.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,20 +208,15 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
208208
gfs2_glock_dq_uninit(&i_gh);
209209

210210
gfs2_set_iop(inode);
211+
unlock_new_inode(inode);
211212
}
212213

213214
if (no_formal_ino && ip->i_no_formal_ino &&
214215
no_formal_ino != ip->i_no_formal_ino) {
215-
error = -ESTALE;
216-
if (inode->i_state & I_NEW)
217-
goto fail;
218216
iput(inode);
219-
return ERR_PTR(error);
217+
return ERR_PTR(-ESTALE);
220218
}
221219

222-
if (inode->i_state & I_NEW)
223-
unlock_new_inode(inode);
224-
225220
return inode;
226221

227222
fail:

0 commit comments

Comments
 (0)