Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp912768rwb; Thu, 18 Aug 2022 14:47:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR44eJvgL4+k56rt4KSFYUgqE6p95Nb4UqP3pwkxJvtfjGJYx4ExKos+e/Uy1V9uyVF6uSUX X-Received: by 2002:a05:6402:3482:b0:43e:dd2:52a3 with SMTP id v2-20020a056402348200b0043e0dd252a3mr3722040edc.386.1660859225088; Thu, 18 Aug 2022 14:47:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660859225; cv=none; d=google.com; s=arc-20160816; b=X3O/atFmiElevuvLLgWKE+iT5PDMh22Ym4QGSZN6NqD/OgxcHWJT4WBGVMJRdMJlgc r3jV2QmzgMr3OXQc3DVjQqoaXTfWODM9HmnaFQCTPe58WmQwBQ8KSEIk5RHdy1UePzJJ YoIB6IFGAFEwhAYVMFvdPWrQpmSmkGyzE+Lo1UhH2kA35Z9L/jy1SXALS+QrAaQENb8S jcY8xCkxYsmskvAYnlfLRsgPVKRfH17uW4nAaw1yEEuGb6u8f22zAMPANEZukPKE7CqA uBUas1eupLOPSkKp4s+qT65QaQKVsxLrykknp/EH+vKHRqOfo/3Bf1vvcPh5eDH53WP+ OSJg== 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:date:subject:cc:to:from :dkim-signature; bh=nrxjaVE4WdIyGQTcKGgqFS8cn5mFR+Wj7Z0M9uQDl1c=; b=tDbIa1wVkQWboC5mScpTiAt/ZSQOnsyJWNA8GIDm8Zkmz+Vkn2TAiwimEhteIentGU nGoHSvYx5vFqtx8NoNDlXzrdcEppFn+yXMs6j+IAVRWpl63yscfZ1J7w2U2IfF/U5q2Y TNbuWYjGFq98z7KZ3oKTPqko1Z79pwzip54S9Oh0+xngR3xp1/F6NINK+vE+nYy/f3Yk NPf8pKuvyZz2yBoYeR9FAcUFeziCBWzFtFDYhRCkwsXU1lBNKL7hdqbCq+BOB1Ql7PuN s8YyEU2sMsPcB+NcbUCHlwG3oeDeoVI6h6PhQtOT1Xyv4KkZpZd12tqgdk+BpL8sWgFl Hfiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=AnqYwWg2; 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 n8-20020a1709065e0800b00730947701dbsi1474432eju.485.2022.08.18.14.46.39; Thu, 18 Aug 2022 14:47:05 -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=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=AnqYwWg2; 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 S1346633AbiHRVKQ (ORCPT + 99 others); Thu, 18 Aug 2022 17:10:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346653AbiHRVJi (ORCPT ); Thu, 18 Aug 2022 17:09:38 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D46FDD83E8 for ; Thu, 18 Aug 2022 14:04:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=i/cB/Phu1FvqlJ UZcqnZVrHrWLtgfn79quY054DY0yo=; b=AnqYwWg2+5/x4Ebwn32vRay29H/8DL p1uEOAfl1FQf43pZCnGbGDUcM2ccV01wfqE3nbebAoE+eOJ0qe9HzMLiN7e3Dp22 JTAlnvDKX7UnGy5Z6dU8Vo+3tnoKfohlluDN2GhRFDtz26GDVwQ9wzE/4yvm5pvN v5ysIgielWJ8E= Received: (qmail 3962138 invoked from network); 18 Aug 2022 23:01:34 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 23:01:34 +0200 X-UD-Smtp-Session: l3s3148p1@f0dYSYrmyZgucref From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Christine Caulfield , David Teigland , cluster-devel@redhat.com Subject: [PATCH 10/14] dlm: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 23:01:19 +0200 Message-Id: <20220818210123.7637-10-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220818210123.7637-1-wsa+renesas@sang-engineering.com> References: <20220818210123.7637-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang --- fs/dlm/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/dlm/config.c b/fs/dlm/config.c index ac8b62106ce0..c15425fe48e3 100644 --- a/fs/dlm/config.c +++ b/fs/dlm/config.c @@ -122,9 +122,9 @@ static ssize_t cluster_cluster_name_store(struct config_item *item, { struct dlm_cluster *cl = config_item_to_cluster(item); - strlcpy(dlm_config.ci_cluster_name, buf, + strscpy(dlm_config.ci_cluster_name, buf, sizeof(dlm_config.ci_cluster_name)); - strlcpy(cl->cl_cluster_name, buf, sizeof(cl->cl_cluster_name)); + strscpy(cl->cl_cluster_name, buf, sizeof(cl->cl_cluster_name)); return len; } -- 2.35.1