From patchwork Thu Sep 28 21:11:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13403544 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A1A4E743C4 for ; Thu, 28 Sep 2023 21:19:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231935AbjI1VT1 (ORCPT ); Thu, 28 Sep 2023 17:19:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230325AbjI1VT0 (ORCPT ); Thu, 28 Sep 2023 17:19:26 -0400 X-Greylist: delayed 452 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 28 Sep 2023 14:19:23 PDT Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4133B19E for ; Thu, 28 Sep 2023 14:19:23 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id lyIVqxYRoFUAIlyIVqcqAN; Thu, 28 Sep 2023 23:11:50 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1695935510; bh=CT0rFoQj+YDKwuwWbEo3e5SQCHTQDs01F+cu4QFHXgE=; h=From:To:Cc:Subject:Date; b=GKDTgvqa9RYXrDd7JRIRmjq5ZV7qkctMPq1hXE3q0NsVLQwHqbGamk6UI1d2nPUpt wmUHjQPqpiZSvfFThnPHZQ2OsNfff/EifuIlFkkCm4pxAgDynuyUt10RDW0/PDJ/aT UPvUPd+uHpExnaTjcnrfd/tYK46sKW2p98W/51Fz1R9mWWGcR56KziyEuF2+VLXSIx x2k+9Ab7Qqdyrc34Tu/2AY4DWIj8qCuvaBo7SBAEZBcTRIkJjOanuxFrmrAjQBGHDf 6F4KAUSeyAOuIB+DMWS8I1GmEtE34dvPw1W+jfFqPlRRlsQO+Mh3i1Z3wEOm/fA+hQ aj0DiKIrWPF5A== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 28 Sep 2023 23:11:50 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Matthew Wilcox , Andrew Morton , "Liam R. Howlett" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-fsdevel@vger.kernel.org Subject: [PATCH] radix tree test suite: Fix a memory initialization issue Date: Thu, 28 Sep 2023 23:11:45 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org If __GFP_ZERO is used, the whole allocated memory should be cleared, not the first part of it only. Fixes: cc86e0c2f306 ("radix tree test suite: add support for slab bulk APIs") Signed-off-by: Christophe JAILLET --- tools/testing/radix-tree/linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c index d587a558997f..8ab162c48629 100644 --- a/tools/testing/radix-tree/linux.c +++ b/tools/testing/radix-tree/linux.c @@ -172,7 +172,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *cachep, gfp_t gfp, size_t size, if (cachep->ctor) cachep->ctor(p[i]); else if (gfp & __GFP_ZERO) - memset(p[i], 0, cachep->size); + memset(p[i], 0, cachep->size * size); } }