aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jfs/namei.c')
-rw-r--r--fs/jfs/namei.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index f8718de3505e..403cfc24c6fe 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -1462,12 +1462,10 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc
1462 } 1462 }
1463 } 1463 }
1464 1464
1465 ip = iget(dip->i_sb, inum); 1465 ip = jfs_iget(dip->i_sb, inum);
1466 if (ip == NULL || is_bad_inode(ip)) { 1466 if (IS_ERR(ip)) {
1467 jfs_err("jfs_lookup: iget failed on inum %d", (uint) inum); 1467 jfs_err("jfs_lookup: iget failed on inum %d", (uint) inum);
1468 if (ip) 1468 return ERR_CAST(ip);
1469 iput(ip);
1470 return ERR_PTR(-EACCES);
1471 } 1469 }
1472 1470
1473 dentry = d_splice_alias(ip, dentry); 1471 dentry = d_splice_alias(ip, dentry);
@@ -1485,12 +1483,11 @@ static struct inode *jfs_nfs_get_inode(struct super_block *sb,
1485 1483
1486 if (ino == 0) 1484 if (ino == 0)
1487 return ERR_PTR(-ESTALE); 1485 return ERR_PTR(-ESTALE);
1488 inode = iget(sb, ino); 1486 inode = jfs_iget(sb, ino);
1489 if (inode == NULL) 1487 if (IS_ERR(inode))
1490 return ERR_PTR(-ENOMEM); 1488 return ERR_CAST(inode);
1491 1489
1492 if (is_bad_inode(inode) || 1490 if (generation && inode->i_generation != generation) {
1493 (generation && inode->i_generation != generation)) {
1494 iput(inode); 1491 iput(inode);
1495 return ERR_PTR(-ESTALE); 1492 return ERR_PTR(-ESTALE);
1496 } 1493 }
@@ -1521,17 +1518,14 @@ struct dentry *jfs_get_parent(struct dentry *dentry)
1521 1518
1522 parent_ino = 1519 parent_ino =
1523 le32_to_cpu(JFS_IP(dentry->d_inode)->i_dtroot.header.idotdot); 1520 le32_to_cpu(JFS_IP(dentry->d_inode)->i_dtroot.header.idotdot);
1524 inode = iget(sb, parent_ino); 1521 inode = jfs_iget(sb, parent_ino);
1525 if (inode) { 1522 if (IS_ERR(inode)) {
1526 if (is_bad_inode(inode)) { 1523 parent = ERR_CAST(inode);
1524 } else {
1525 parent = d_alloc_anon(inode);
1526 if (!parent) {
1527 parent = ERR_PTR(-ENOMEM);
1527 iput(inode); 1528 iput(inode);
1528 parent = ERR_PTR(-EACCES);
1529 } else {
1530 parent = d_alloc_anon(inode);
1531 if (!parent) {
1532 parent = ERR_PTR(-ENOMEM);
1533 iput(inode);
1534 }
1535 } 1529 }
1536 } 1530 }
1537 1531