From 25f741023997fdd87e123e2ee91f399ce77a8856 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 21 May 2012 17:30:14 +0200 Subject: [PATCH] --- yaml --- r: 310063 b: refs/heads/master c: 5f5daac12a4cef568d1269be0215fec0667193c1 h: refs/heads/master i: 310061: c820289d3f32c80a3902171edb5715a128351863 310059: 65c343fd8b27a8eb0efc2edf7cd4c01a0ebab7b8 310055: 25a2f953c088edbaa1ded937fd3be25921419a36 310047: f4aedbd785e934daf2614782bf188c07ee3344ad v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 34 +++------------------------------- 2 files changed, 4 insertions(+), 32 deletions(-) diff --git a/[refs] b/[refs] index ac9a6bbb98e8..fb4c01069f78 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d7fdd7f6e1afbffda03aeacb90039c092e8cacf8 +refs/heads/master: 5f5daac12a4cef568d1269be0215fec0667193c1 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 125386c250bb..998d5316921a 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -2249,37 +2249,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path, inode = path->dentry->d_inode; } - error = -ENOENT; - if (!inode) { - path_to_nameidata(path, nd); - goto exit; - } - - if (should_follow_link(inode, !symlink_ok)) { - if (nd->flags & LOOKUP_RCU) { - if (unlikely(unlazy_walk(nd, path->dentry))) { - error = -ECHILD; - goto exit; - } - } - BUG_ON(inode != path->dentry->d_inode); - return NULL; - } - path_to_nameidata(path, nd); - nd->inode = inode; - - /* sayonara */ - error = complete_walk(nd); - if (error) - return ERR_PTR(error); - - error = -ENOTDIR; - if (nd->flags & LOOKUP_DIRECTORY) { - if (!nd->inode->i_op->lookup) - goto exit; - } - audit_inode(pathname, nd->path.dentry); - goto ok; + goto finish_lookup; } /* create side of things */ @@ -2360,6 +2330,8 @@ static struct file *do_last(struct nameidata *nd, struct path *path, BUG_ON(nd->flags & LOOKUP_RCU); inode = path->dentry->d_inode; +finish_lookup: + /* we _can_ be in RCU mode here */ error = -ENOENT; if (!inode) { path_to_nameidata(path, nd);