Loading fs/namei.c +20 −25 Original line number Original line Diff line number Diff line Loading @@ -1174,23 +1174,13 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, mutex_lock(&dir->i_mutex); mutex_lock(&dir->i_mutex); dentry = d_lookup(parent, name); dentry = d_lookup(parent, name); if (likely(!dentry)) { if (dentry && d_need_lookup(dentry)) { dentry = d_alloc_and_lookup(parent, name, nd); if (IS_ERR(dentry)) { mutex_unlock(&dir->i_mutex); return PTR_ERR(dentry); } /* known good */ status = 1; } else if (unlikely(d_need_lookup(dentry))) { dentry = d_inode_lookup(parent, dentry, nd); dentry = d_inode_lookup(parent, dentry, nd); if (IS_ERR(dentry)) { if (IS_ERR(dentry)) { mutex_unlock(&dir->i_mutex); mutex_unlock(&dir->i_mutex); return PTR_ERR(dentry); return PTR_ERR(dentry); } } /* known good */ } else if (dentry && (dentry->d_flags & DCACHE_OP_REVALIDATE)) { status = 1; } else if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) status = d_revalidate(dentry, nd); status = d_revalidate(dentry, nd); if (unlikely(status <= 0)) { if (unlikely(status <= 0)) { if (status < 0) { if (status < 0) { Loading @@ -1205,8 +1195,13 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, mutex_unlock(&dir->i_mutex); mutex_unlock(&dir->i_mutex); return PTR_ERR(dentry); return PTR_ERR(dentry); } } /* known good */ } status = 1; } } else if (!dentry) { dentry = d_alloc_and_lookup(parent, name, nd); if (IS_ERR(dentry)) { mutex_unlock(&dir->i_mutex); return PTR_ERR(dentry); } } } } mutex_unlock(&dir->i_mutex); mutex_unlock(&dir->i_mutex); Loading Loading
fs/namei.c +20 −25 Original line number Original line Diff line number Diff line Loading @@ -1174,23 +1174,13 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, mutex_lock(&dir->i_mutex); mutex_lock(&dir->i_mutex); dentry = d_lookup(parent, name); dentry = d_lookup(parent, name); if (likely(!dentry)) { if (dentry && d_need_lookup(dentry)) { dentry = d_alloc_and_lookup(parent, name, nd); if (IS_ERR(dentry)) { mutex_unlock(&dir->i_mutex); return PTR_ERR(dentry); } /* known good */ status = 1; } else if (unlikely(d_need_lookup(dentry))) { dentry = d_inode_lookup(parent, dentry, nd); dentry = d_inode_lookup(parent, dentry, nd); if (IS_ERR(dentry)) { if (IS_ERR(dentry)) { mutex_unlock(&dir->i_mutex); mutex_unlock(&dir->i_mutex); return PTR_ERR(dentry); return PTR_ERR(dentry); } } /* known good */ } else if (dentry && (dentry->d_flags & DCACHE_OP_REVALIDATE)) { status = 1; } else if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) status = d_revalidate(dentry, nd); status = d_revalidate(dentry, nd); if (unlikely(status <= 0)) { if (unlikely(status <= 0)) { if (status < 0) { if (status < 0) { Loading @@ -1205,8 +1195,13 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, mutex_unlock(&dir->i_mutex); mutex_unlock(&dir->i_mutex); return PTR_ERR(dentry); return PTR_ERR(dentry); } } /* known good */ } status = 1; } } else if (!dentry) { dentry = d_alloc_and_lookup(parent, name, nd); if (IS_ERR(dentry)) { mutex_unlock(&dir->i_mutex); return PTR_ERR(dentry); } } } } mutex_unlock(&dir->i_mutex); mutex_unlock(&dir->i_mutex); Loading