From aa7a0c0a26c28449c7c0b9d2a6d36940a074ea15 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 5 Jun 2012 15:10:12 +0200 Subject: [PATCH] --- yaml --- r: 312883 b: refs/heads/master c: 37d7fffc9cafe75ded8a840fa30ba625f99ed7ae h: refs/heads/master i: 312881: 7af57ce69dad061e74527a53c8c69a6ff4233a50 312879: b8be360c3fc96e294e6e21c8052ceb744e8b1289 v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 424cbabc4300..a051ae40c5a5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6d7b5aaed7d887b34f29f900244cdbd17a86637c +refs/heads/master: 37d7fffc9cafe75ded8a840fa30ba625f99ed7ae diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 6135a14d5a84..68742e3cb98d 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -2254,9 +2254,22 @@ static struct file *do_last(struct nameidata *nd, struct path *path, if (error < 0) goto exit; - error = lookup_slow(nd, &nd->last, path); - if (error < 0) + BUG_ON(nd->inode != dir->d_inode); + + mutex_lock(&dir->d_inode->i_mutex); + dentry = __lookup_hash(&nd->last, dir, nd); + mutex_unlock(&dir->d_inode->i_mutex); + error = PTR_ERR(dentry); + if (IS_ERR(dentry)) goto exit; + path->mnt = nd->path.mnt; + path->dentry = dentry; + error = follow_managed(path, nd->flags); + if (unlikely(error < 0)) + goto exit_dput; + + if (error) + nd->flags |= LOOKUP_JUMPED; inode = path->dentry->d_inode; }