From nobody Fri Apr 10 21:56:01 2026 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 8662CC00140 for ; Thu, 18 Aug 2022 21:11:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346814AbiHRVLj (ORCPT ); Thu, 18 Aug 2022 17:11:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346501AbiHRVKJ (ORCPT ); Thu, 18 Aug 2022 17:10:09 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB475D86FD for ; Thu, 18 Aug 2022 14:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=k1; bh=i/cB/Phu1FvqlJUZcqnZVrHrWLt gfn79quY054DY0yo=; b=dOqt/qj0l7hq56CvL0bQx0Hux9ubK4m6+49TLTRy2uA F3VA4GSz8+/SeMeY3kl5leK3/bxLKtdg+WE7JpUG1F0D07jCiuqHDaT23+Xt32gM N6G2UHsmHNFUkXF6XcDPUS9NFSqGzRbkjEFZqBRrUn44L1rgrsaIbFbsV2IlUYdk = Received: (qmail 3962312 invoked from network); 18 Aug 2022 23:01:43 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 23:01:43 +0200 X-UD-Smtp-Session: l3s3148p1@bQXoSYrmB+Qucref From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Christine Caulfield , David Teigland , cluster-devel@redhat.com Subject: [PATCH] dlm: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 23:01:43 +0200 Message-Id: <20220818210143.7891-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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-=3DwgfRnXz0W3D37d01q3JFkr_i_uTL=3DV6A6= G1oUZcprmknw@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 =3D config_item_to_cluster(item); =20 - 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; } =20 --=20 2.35.1