提交 f5be3e29 编写于 作者: A Al Viro

fix bogus read_seqretry() checks introduced in b37199e6

read_seqretry() returns true on mismatch, not on match...

Cc: stable@vger.kernel.org # 3.15+
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 6f18493e
...@@ -1137,7 +1137,7 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path, ...@@ -1137,7 +1137,7 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
*/ */
*inode = path->dentry->d_inode; *inode = path->dentry->d_inode;
} }
return read_seqretry(&mount_lock, nd->m_seq) && return !read_seqretry(&mount_lock, nd->m_seq) &&
!(path->dentry->d_flags & DCACHE_NEED_AUTOMOUNT); !(path->dentry->d_flags & DCACHE_NEED_AUTOMOUNT);
} }
...@@ -1174,7 +1174,7 @@ static int follow_dotdot_rcu(struct nameidata *nd) ...@@ -1174,7 +1174,7 @@ static int follow_dotdot_rcu(struct nameidata *nd)
nd->path.mnt = &mounted->mnt; nd->path.mnt = &mounted->mnt;
nd->path.dentry = mounted->mnt.mnt_root; nd->path.dentry = mounted->mnt.mnt_root;
nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq); nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq);
if (!read_seqretry(&mount_lock, nd->m_seq)) if (read_seqretry(&mount_lock, nd->m_seq))
goto failed; goto failed;
} }
nd->inode = nd->path.dentry->d_inode; nd->inode = nd->path.dentry->d_inode;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册