don't bugger nd->seq on set_root_rcu() from follow_dotdot_rcu()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 14 Sep 2014 01:55:46 +0000 (21:55 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 21:52:21 +0000 (14:52 -0700)
commitaed47136eb7505bd7f08cb790e7c288c9f3a2fb1
tree581dc015fccd28195978f9e212d8f50a5df3470e
parentafb3378f30b6fe6079d04c84052c7308661c27a9
don't bugger nd->seq on set_root_rcu() from follow_dotdot_rcu()

commit 7bd88377d482e1eae3c5329b12e33cfd664fa6a9 upstream.

return the value instead, and have path_init() do the assignment.  Broken by
"vfs: Fix absolute RCU path walk failures due to uninitialized seq number",
which was Cc-stable with 2.6.38+ as destination.  This one should go where
it went.

To avoid dummy value returned in case when root is already set (it would do
no harm, actually, since the only caller that doesn't ignore the return value
is guaranteed to have nd->root *not* set, but it's more obvious that way),
lift the check into callers.  And do the same to set_root(), to keep them
in sync.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/namei.c