summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2014-12-05 23:41:33 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-09 15:51:08 -0800
commit72392ed0eb6fde96826cb9d66bd4f50a7ba61450 (patch)
tree488408d7485349d5df0b3f4cca74cda5e9be4518 /Documentation
parentb7392d2247cfe6771f95d256374f1a8e6a6f48d6 (diff)
downloadlinux-72392ed0eb6fde96826cb9d66bd4f50a7ba61450.tar.bz2
kernfs: Fix kernfs_name_compare
Returning a difference from a comparison functions is usually wrong (see acbbe6fbb240 "kcmp: fix standard comparison bug" for the long story). Here there is the additional twist that if the void pointers ns and kn->ns happen to differ by a multiple of 2^32, kernfs_name_compare returns 0, falsely reporting a match to the caller. Technically 'hash - kn->hash' is ok since the hashes are restricted to 31 bits, but it's better to avoid that subtlety. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions