lkml.org 
[lkml]   [2003]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[patch] namespace.c fix
Yet another one in the namespace.c series.

The code in graft_tree() used to be correct, but the code

err = -ENOENT;
down(&nd->dentry->d_inode->i_sem);
if (IS_DEADDIR(nd->dentry->d_inode))
goto out_unlock;

spin_lock(&dcache_lock);
if (IS_ROOT(nd->dentry) || !d_unhashed(nd->dentry)) {
...
}
spin_unlock(&dcache_lock);
out_unlock:

was made incorrect in 2.5.29 when

err = security_sb_check_sb(mnt, nd);
if (err)
goto out_unlock;

was inserted. It has happened more often that people overlooked
a preexisting setting of err.

Andries

----------------------------------------------------------------
diff -u --recursive --new-file -X /linux/dontdiff a/fs/namespace.c b/fs/namespace.c
--- a/fs/namespace.c Sun May 25 17:54:02 2003
+++ b/fs/namespace.c Sun May 25 23:41:25 2003
@@ -486,9 +486,11 @@
if (err)
goto out_unlock;

+ err = -ENOENT;
spin_lock(&dcache_lock);
if (IS_ROOT(nd->dentry) || !d_unhashed(nd->dentry)) {
struct list_head head;
+
attach_mnt(mnt, nd);
list_add_tail(&head, &mnt->mnt_list);
list_splice(&head, current->namespace->list.prev);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.021 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site