Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4925155imw; Tue, 19 Jul 2022 16:25:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uP+isic+X0Ty47Eqe6u+JbwCV7J2yqN5p4R7t2Ng6avFGwpsj81SiALmvBkaFUulVK03SV X-Received: by 2002:a05:6402:2287:b0:43b:a9d:ab1 with SMTP id cw7-20020a056402228700b0043b0a9d0ab1mr46363732edb.325.1658273156600; Tue, 19 Jul 2022 16:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658273156; cv=none; d=google.com; s=arc-20160816; b=Bgx+dWGyYsOMraJFZPz2jQhoCYEFxhKv5jMr0NNZmU9Y1uDucg65M1vULuTtHr70VC pxJManDM3uIsQMGSlKFTohLb20Ebwo/JNqpRBCv9X8fy3EKq6AP1WccYjQslbpY1bauw PX68QJuARK+FSTYmKzTsLM4I4161nAdYbaWV742P7l+SF3jr3sUgLmRCRWi3PDGvUeSM 3N5cPRJjlTuuNqJT832aB2uRKNmY7mTgH5hqWDKC6psASiwSEj2HXhXhrzvB2gDLHFVC v+fCIVd+fCNTtRJ4PfeE7lPdqSnYTHwLJntae4+In1JE0VERkJpfOVJl1gQnGm1BpvrT 7CVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=n7RnzuyAWJlt+5SUjAQhsAzk9uMJcIL3Z0LOjev68Bk=; b=KDcSved592TOGf8TcP1UFuStkol6NIP8ie0WAkxuWvnRSs2N/fHS/dJK5BGeAv7A1j ReD0q0oE8Qs5GKXv+02cJxr3Idog/7Cwb4LpvxU4WcW3EA9jPgs0WAVK6nwSIU/mS0K0 2tD45vbFc8TlqXSKSFR5nd1jfu4iK8thZJOPN8mXmlJsHh7fLgPta5Lan9dmWPzyQQ0j 39C1bH8RBK/i3kYQeTUjd9OOCIF6tUdO+dy9Uc0KkZnHe/NFjVYKpcDO1uf2O5C1BKfi hZdUDwO8MYvP4X+m6VFa/o9/3RhodVRmjk3lW2t87jXdIXyk0gtzaSawDpagVvGMtLwA A8zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=ZtOYXNG1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs31-20020a1709073e9f00b0072b3a7457fesi5614371ejc.846.2022.07.19.16.25.31; Tue, 19 Jul 2022 16:25:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=ZtOYXNG1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230229AbiGSXSm (ORCPT + 99 others); Tue, 19 Jul 2022 19:18:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbiGSXSl (ORCPT ); Tue, 19 Jul 2022 19:18:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB6E461DB0 for ; Tue, 19 Jul 2022 16:18:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 85F2C611D4 for ; Tue, 19 Jul 2022 23:18:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACA5FC341C6; Tue, 19 Jul 2022 23:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1658272717; bh=S/Ko8haKDUWIwe8GQ22WOUmDVnhESOeTjPOKRncyQn8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZtOYXNG1wlt556bN7zEmTA2lJDf6kkFdAeHr6U2Qsa7taNbYqqLBefO9y556hWX3X JxFLPfxhD4/Y1zvDfO10/olmtg9e6isE7Hj24IPpwMLQzMA+3gFi2VmMKXYyA+6M+q dPhnM8Yg55a36K/PCYBUZD91i4vE5KEhjgoXs5z4= Date: Tue, 19 Jul 2022 16:18:36 -0700 From: Andrew Morton To: Kassey Li Cc: linux-kernel@vger.kernel.org, Sasha Levin , Joonsoo Kim , Minchan Kim Subject: Re: [PATCH] mm/cma_debug.c: align the name buffer length as struct cma Message-Id: <20220719161836.b0ad5cdfb0aec0c04a862122@linux-foundation.org> In-Reply-To: <20220719091554.27864-1-quic_yingangl@quicinc.com> References: <20220719091554.27864-1-quic_yingangl@quicinc.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Jul 2022 17:15:54 +0800 Kassey Li wrote: > Signed-off-by: Kassey Li > --- > mm/cma_debug.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/cma_debug.c b/mm/cma_debug.c > index 2e7704955f4f..c3ffe253e055 100644 > --- a/mm/cma_debug.c > +++ b/mm/cma_debug.c > @@ -163,7 +163,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(cma_alloc_fops, NULL, cma_alloc_write, "%llu\n"); > static void cma_debugfs_add_one(struct cma *cma, struct dentry *root_dentry) > { > struct dentry *tmp; > - char name[16]; > + char name[CMA_MAX_NAME]; > > scnprintf(name, sizeof(name), "cma-%s", cma->name); Seems logical. But as CMA_MAX_NAME=64, this could result in alteration of the output: less truncation of the original name. Is it the case that the output is never >16 chars anyway? If so, we'll be OK.