From 8e6e8242621f52b6ee4597015b3e622934dfd9c1 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 5 Nov 2008 15:07:21 +0100 Subject: [PATCH] --- yaml --- r: 124999 b: refs/heads/master c: b4091d5f6fde28ab762e1094a1a26d81f3badfa5 h: refs/heads/master i: 124997: 3b160794c0e94e38f1652f7bd9e3eaa6c91ea06d 124995: c9a12ea76eeb2d4677d4bbac16abf1473ba4fb7e 124991: b320c0958ebd31aed6fda4a7f492d5d8cf0496f0 v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 21 ++++++++------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index 5b92a543b53d..98d215406c1d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 66f221875dc10813aa2f06c83ad60d0eb1356406 +refs/heads/master: b4091d5f6fde28ab762e1094a1a26d81f3badfa5 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 631cfdd45c68..d4d0b59ed2cc 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -526,18 +526,6 @@ static struct dentry * real_lookup(struct dentry * parent, struct qstr * name, s return result; } -/* SMP-safe */ -static __always_inline void -walk_init_root(const char *name, struct nameidata *nd) -{ - struct fs_struct *fs = current->fs; - - read_lock(&fs->lock); - nd->path = fs->root; - path_get(&fs->root); - read_unlock(&fs->lock); -} - /* * Wrapper to retry pathname resolution whenever the underlying * file system returns an ESTALE. @@ -575,9 +563,16 @@ static __always_inline int __vfs_follow_link(struct nameidata *nd, const char *l goto fail; if (*link == '/') { + struct fs_struct *fs = current->fs; + path_put(&nd->path); - walk_init_root(link, nd); + + read_lock(&fs->lock); + nd->path = fs->root; + path_get(&fs->root); + read_unlock(&fs->lock); } + res = link_path_walk(link, nd); if (nd->depth || res || nd->last_type!=LAST_NORM) return res;