aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-08-10 18:04:30 -0700
committerColin Cross <ccross@android.com>2011-08-10 18:04:30 -0700
commit4e111751cfcb75f26d2725eab934b6eb91a3d115 (patch)
treeb3d63b5b44bd2036db6e0f0b2e81769c84cc5ca3 /fs/namei.c
parentca64b0cd3a12d7704f4e98f4f5d51f41eb5047a2 (diff)
parent02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff)
downloadkernel_samsung_espresso10-4e111751cfcb75f26d2725eab934b6eb91a3d115.zip
kernel_samsung_espresso10-4e111751cfcb75f26d2725eab934b6eb91a3d115.tar.gz
kernel_samsung_espresso10-4e111751cfcb75f26d2725eab934b6eb91a3d115.tar.bz2
Merge commit 'v3.0' into android-3.0
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 0223c41..14ab8d3 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -433,6 +433,8 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
goto err_parent;
BUG_ON(nd->inode != parent->d_inode);
} else {
+ if (dentry->d_parent != parent)
+ goto err_parent;
spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
if (!__d_rcu_to_refcount(dentry, nd->seq))
goto err_child;
@@ -940,7 +942,6 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
* Don't forget we might have a non-mountpoint managed dentry
* that wants to block transit.
*/
- *inode = path->dentry->d_inode;
if (unlikely(managed_dentry_might_block(path->dentry)))
return false;
@@ -953,6 +954,12 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
path->mnt = mounted;
path->dentry = mounted->mnt_root;
nd->seq = read_seqcount_begin(&path->dentry->d_seq);
+ /*
+ * Update the inode too. We don't need to re-check the
+ * dentry sequence number here after this d_inode read,
+ * because a mount-point is always pinned.
+ */
+ *inode = path->dentry->d_inode;
}
return true;
}