]> git.baikalelectronics.ru Git - kernel.git/commit
lib/stackdepot: avoid to return 0 handle
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>
Thu, 5 May 2016 23:22:35 +0000 (16:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 May 2016 00:38:53 +0000 (17:38 -0700)
commitf0a7c48fd7be5d4a4969d958ee15c1a7e0c0c2d3
tree3d9c55c6df3e04a3c0a87106d4d424e8db1bcdb9
parent91eb29d47a70c6ff95db86c74cf4b9b700265011
lib/stackdepot: avoid to return 0 handle

Recently, we allow to save the stacktrace whose hashed value is 0.  It
causes the problem that stackdepot could return 0 even if in success.
User of stackdepot cannot distinguish whether it is success or not so we
need to solve this problem.  In this patch, 1 bit are added to handle
and make valid handle none 0 by setting this bit.  After that, valid
handle will not be 0 and 0 handle will represent failure correctly.

Fixes: a65a231eda27 ("lib/stackdepot.c: allow the stack trace hash to be zero")
Link: http://lkml.kernel.org/r/1462252403-1106-1-git-send-email-iamjoonsoo.kim@lge.com
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/stackdepot.c