@@ -1593,22 +1593,21 @@ static int lookup_fast(struct nameidata *nd,
1593
1593
}
1594
1594
1595
1595
/* Fast lookup failed, do it the slow way */
1596
- static struct dentry * lookup_slow (const struct qstr * name ,
1597
- struct dentry * dir ,
1598
- unsigned int flags )
1596
+ static struct dentry * __lookup_slow (const struct qstr * name ,
1597
+ struct dentry * dir ,
1598
+ unsigned int flags )
1599
1599
{
1600
- struct dentry * dentry = ERR_PTR ( - ENOENT ) , * old ;
1600
+ struct dentry * dentry , * old ;
1601
1601
struct inode * inode = dir -> d_inode ;
1602
1602
DECLARE_WAIT_QUEUE_HEAD_ONSTACK (wq );
1603
1603
1604
- inode_lock_shared (inode );
1605
1604
/* Don't go there if it's already dead */
1606
1605
if (unlikely (IS_DEADDIR (inode )))
1607
- goto out ;
1606
+ return ERR_PTR ( - ENOENT ) ;
1608
1607
again :
1609
1608
dentry = d_alloc_parallel (dir , name , & wq );
1610
1609
if (IS_ERR (dentry ))
1611
- goto out ;
1610
+ return dentry ;
1612
1611
if (unlikely (!d_in_lookup (dentry ))) {
1613
1612
if (!(flags & LOOKUP_NO_REVAL )) {
1614
1613
int error = d_revalidate (dentry , flags );
@@ -1630,11 +1629,21 @@ static struct dentry *lookup_slow(const struct qstr *name,
1630
1629
dentry = old ;
1631
1630
}
1632
1631
}
1633
- out :
1634
- inode_unlock_shared (inode );
1635
1632
return dentry ;
1636
1633
}
1637
1634
1635
+ static struct dentry * lookup_slow (const struct qstr * name ,
1636
+ struct dentry * dir ,
1637
+ unsigned int flags )
1638
+ {
1639
+ struct inode * inode = dir -> d_inode ;
1640
+ struct dentry * res ;
1641
+ inode_lock_shared (inode );
1642
+ res = __lookup_slow (name , dir , flags );
1643
+ inode_unlock_shared (inode );
1644
+ return res ;
1645
+ }
1646
+
1638
1647
static inline int may_lookup (struct nameidata * nd )
1639
1648
{
1640
1649
if (nd -> flags & LOOKUP_RCU ) {
0 commit comments