Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752370AbcDOQ0u (ORCPT ); Fri, 15 Apr 2016 12:26:50 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:36366 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751415AbcDOQ0t (ORCPT ); Fri, 15 Apr 2016 12:26:49 -0400 Subject: Re: [PATCH v2] lib/stackdepot.c: allow the stack trace hash to be zero To: Alexander Potapenko , adech.fo@gmail.com, dvyukov@google.com, cl@linux.com, akpm@linux-foundation.org, kcc@google.com, iamjoonsoo.kim@lge.com References: <1460549245-131634-1-git-send-email-glider@google.com> Cc: kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org From: Andrey Ryabinin Message-ID: <5711165F.5080304@gmail.com> Date: Fri, 15 Apr 2016 19:27:11 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <1460549245-131634-1-git-send-email-glider@google.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 967 Lines: 32 On 04/13/2016 03:07 PM, Alexander Potapenko wrote: > Do not bail out from depot_save_stack() if the stack trace has zero hash. > Initially depot_save_stack() silently dropped stack traces with zero > hashes, however there's actually no point in reserving this zero value. > > Reported-by: Joonsoo Kim > Signed-off-by: Alexander Potapenko Acked-by: Andrey Ryabinin > --- > lib/stackdepot.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/lib/stackdepot.c b/lib/stackdepot.c > index 654c9d8..9e0b031 100644 > --- a/lib/stackdepot.c > +++ b/lib/stackdepot.c > @@ -210,10 +210,6 @@ depot_stack_handle_t depot_save_stack(struct stack_trace *trace, > goto fast_exit; > > hash = hash_stack(trace->entries, trace->nr_entries); > - /* Bad luck, we won't store this stack. */ > - if (hash == 0) > - goto exit; > - > bucket = &stack_table[hash & STACK_HASH_MASK]; > > /* >