Commit 6a1bd4a5 authored by Mark Fasheh's avatar Mark Fasheh

ocfs2: cleanup ocfs2_iget() errors

Get rid of some error prints in the ocfs2_iget() path from
ocfs2_get_dentry(). NFSD can easily cause us to read stale inodes.
Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
parent 592282cf
...@@ -60,14 +60,11 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, void *vobjp) ...@@ -60,14 +60,11 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, void *vobjp)
inode = ocfs2_iget(OCFS2_SB(sb), handle->ih_blkno, 0); inode = ocfs2_iget(OCFS2_SB(sb), handle->ih_blkno, 0);
if (IS_ERR(inode)) { if (IS_ERR(inode))
mlog_errno(PTR_ERR(inode));
return (void *)inode; return (void *)inode;
}
if (handle->ih_generation != inode->i_generation) { if (handle->ih_generation != inode->i_generation) {
iput(inode); iput(inode);
mlog_errno(-ESTALE);
return ERR_PTR(-ESTALE); return ERR_PTR(-ESTALE);
} }
......
...@@ -146,7 +146,6 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, int flags) ...@@ -146,7 +146,6 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, int flags)
if (is_bad_inode(inode)) { if (is_bad_inode(inode)) {
iput(inode); iput(inode);
inode = ERR_PTR(-ESTALE); inode = ERR_PTR(-ESTALE);
mlog_errno(PTR_ERR(inode));
goto bail; goto bail;
} }
...@@ -155,8 +154,7 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, int flags) ...@@ -155,8 +154,7 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, int flags)
mlog(0, "returning inode with number %llu\n", mlog(0, "returning inode with number %llu\n",
(unsigned long long)OCFS2_I(inode)->ip_blkno); (unsigned long long)OCFS2_I(inode)->ip_blkno);
mlog_exit_ptr(inode); mlog_exit_ptr(inode);
} else }
mlog_errno(PTR_ERR(inode));
return inode; return inode;
} }
...@@ -247,7 +245,7 @@ int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, ...@@ -247,7 +245,7 @@ int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
* today. change if needed. */ * today. change if needed. */
if (!OCFS2_IS_VALID_DINODE(fe) || if (!OCFS2_IS_VALID_DINODE(fe) ||
!(fe->i_flags & cpu_to_le32(OCFS2_VALID_FL))) { !(fe->i_flags & cpu_to_le32(OCFS2_VALID_FL))) {
mlog(ML_ERROR, "Invalid dinode: i_ino=%lu, i_blkno=%llu, " mlog(0, "Invalid dinode: i_ino=%lu, i_blkno=%llu, "
"signature = %.*s, flags = 0x%x\n", "signature = %.*s, flags = 0x%x\n",
inode->i_ino, inode->i_ino,
(unsigned long long)le64_to_cpu(fe->i_blkno), 7, (unsigned long long)le64_to_cpu(fe->i_blkno), 7,
...@@ -478,11 +476,8 @@ static int ocfs2_read_locked_inode(struct inode *inode, ...@@ -478,11 +476,8 @@ static int ocfs2_read_locked_inode(struct inode *inode,
S_ISBLK(le16_to_cpu(fe->i_mode))) S_ISBLK(le16_to_cpu(fe->i_mode)))
inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.i_rdev)); inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.i_rdev));
if (ocfs2_populate_inode(inode, fe, 0) < 0) { if (ocfs2_populate_inode(inode, fe, 0) < 0)
mlog(ML_ERROR, "populate failed! i_blkno=%llu, i_ino=%lu\n",
(unsigned long long)fe->i_blkno, inode->i_ino);
goto bail; goto bail;
}
BUG_ON(args->fi_blkno != le64_to_cpu(fe->i_blkno)); BUG_ON(args->fi_blkno != le64_to_cpu(fe->i_blkno));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment