]> git.baikalelectronics.ru Git - kernel.git/commit
make prepend_name() work correctly when called with negative *buflen
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 23 Mar 2014 04:28:40 +0000 (00:28 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 23 Mar 2014 04:28:40 +0000 (00:28 -0400)
commitf4109ee5c7b30a44acd8b7d6fae1ea1a45076b9d
tree719a3ab8be442c786a9d5b02276ad8aaf989075a
parent2a9457ec6e78a5022862ca11d93cc3bac2742eae
make prepend_name() work correctly when called with negative *buflen

In all callchains leading to prepend_name(), the value left in *buflen
is eventually discarded unused if prepend_name() has returned a negative.
So we are free to do what prepend() does, and subtract from *buflen
*before* checking for underflow (which turns into checking the sign
of subtraction result, of course).

Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/dcache.c