diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2014-10-19 23:07:02 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2014-11-05 20:27:43 +0000 |
commit | a7caf25487f8b0d85f0fa0eb9403301f2b35c1b1 (patch) | |
tree | 49f94d7107f923a04c5a4f74ac393ed405c010ef /fs | |
parent | 035cbfd39f2f97948193448e2c27ccba84b3e30b (diff) |
vfs: Fold follow_mount_rcu() into follow_dotdot_rcu()
This is needed before commit 4023bfc9f351 ('be careful with nd->inode
in path_init() and follow_dotdot_rcu()'). A similar change was made
upstream as part of commit b37199e626b3 ('rcuwalk: recheck mount_lock
after mountpoint crossing attempts').
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/namei.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/fs/namei.c b/fs/namei.c index 4945ef692c66..032053018b8a 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -911,19 +911,6 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path, return true; } -static void follow_mount_rcu(struct nameidata *nd) -{ - while (d_mountpoint(nd->path.dentry)) { - struct vfsmount *mounted; - mounted = __lookup_mnt(nd->path.mnt, nd->path.dentry, 1); - if (!mounted) - break; - nd->path.mnt = mounted; - nd->path.dentry = mounted->mnt_root; - nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq); - } -} - static int follow_dotdot_rcu(struct nameidata *nd) { if (!nd->root.mnt) @@ -950,7 +937,15 @@ static int follow_dotdot_rcu(struct nameidata *nd) break; nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq); } - follow_mount_rcu(nd); + while (d_mountpoint(nd->path.dentry)) { + struct vfsmount *mounted; + mounted = __lookup_mnt(nd->path.mnt, nd->path.dentry, 1); + if (!mounted) + break; + nd->path.mnt = mounted; + nd->path.dentry = mounted->mnt_root; + nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq); + } nd->inode = nd->path.dentry->d_inode; return 0; |