]> git.baikalelectronics.ru Git - kernel.git/commit
namei: make sure nd->depth is always valid
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 3 Apr 2021 20:49:44 +0000 (16:49 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 7 Apr 2021 17:57:17 +0000 (13:57 -0400)
commit11c0c03b91db63ad31249c0047cf4387445d8f77
tree84f59052df80a9436d7dc018ad8c3017f6df2ea3
parent41831f45b9c2dce2074f19b4df036321b18a8e96
namei: make sure nd->depth is always valid

Zero it in set_nameidata() rather than in path_init().  That way
it always matches the number of valid nd->stack[] entries.
Since terminate_walk() does zero it (after having emptied the
stack), we don't need to reinitialize it in subsequent path_init().

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