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)
committerJiri Slaby <jslaby@suse.cz>
Mon, 13 Oct 2014 13:41:32 +0000 (15:41 +0200)
commit11dbe17a1d27cb81e06c52e631de8bc2b17c5e5c
treebae06f0dd4395d26c07ba6b775a565409ae356ae
parent6b4238b59f17764ee24f7e1731ef9a037758394d
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: Jiri Slaby <jslaby@suse.cz>
fs/namei.c