[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1431555975-25997-1-git-send-email-viro@ZenIV.linux.org.uk>
Date: Wed, 13 May 2015 23:25:55 +0100
From: Al Viro <viro@...IV.linux.org.uk>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Neil Brown <neilb@...e.de>, Christoph Hellwig <hch@...radead.org>,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: [PATCH 01/21] namei: unlazy_walk() doesn't need to mess with current->fs anymore
From: Al Viro <viro@...iv.linux.org.uk>
now that we have ->root_seq, legitimize_path(&nd->root, nd->root_seq)
will do just fine...
Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
---
fs/namei.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index 3ee1d65..e736722 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -651,7 +651,6 @@ static bool legitimize_links(struct nameidata *nd)
*/
static int unlazy_walk(struct nameidata *nd, struct dentry *dentry, unsigned seq)
{
- struct fs_struct *fs = current->fs;
struct dentry *parent = nd->path.dentry;
BUG_ON(!(nd->flags & LOOKUP_RCU));
@@ -691,13 +690,11 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry, unsigned seq
* still valid and get it if required.
*/
if (nd->root.mnt && !(nd->flags & LOOKUP_ROOT)) {
- spin_lock(&fs->lock);
- if (unlikely(!path_equal(&nd->root, &fs->root))) {
- spin_unlock(&fs->lock);
- goto drop_dentry;
+ if (unlikely(!legitimize_path(nd, &nd->root, nd->root_seq))) {
+ rcu_read_unlock();
+ dput(dentry);
+ return -ECHILD;
}
- path_get(&nd->root);
- spin_unlock(&fs->lock);
}
rcu_read_unlock();
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists