Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1743403rwb; Fri, 19 Aug 2022 08:40:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR50r+TigwB8PiEd/AbHbNn98+nTaMFPnzDQYoEz57rdvxAiv7PXLakRIgNa1+p0P3t3VRpr X-Received: by 2002:a63:4b49:0:b0:427:e7f2:c04 with SMTP id k9-20020a634b49000000b00427e7f20c04mr6692992pgl.262.1660923647764; Fri, 19 Aug 2022 08:40:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660923647; cv=none; d=google.com; s=arc-20160816; b=MGE69pXJuDmI9deGxJsgGoGJf5F6DaMgiqypypPLra+EJd6UZuLSMthq2WKJJWrXEa V0sRZ53Vlar06i9uOoonN+b5uCdEf59nOzIQJqQIuzCb710+iKFzzb9ikTcioduxbUXl mmW4NJGw/aitM58QMPggXQjqHF/yKdtEm4F+3L+ccegK7PWJaw4UhPwkfuj+qqDgi2Gi VGaoKee/HwCR9C+nFDJ5TJW+jaoD+pkl2ySugnpyQvC8dPO1j3BwNta3YFvjus2W0GZS 9Llh5UPF/nrGFzPMzsXpnA16nZTZLio350a48s/2lsWI8L/xlxXS75LwZpr5yTUYW87R yKvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=QcjuSMkjgvmcMVSZtEnP4HKDq1IJJzuLOO5WZsbK0+U=; b=mHaxvCyXjv3E+tTGEn2ndKTMHJqsjTECBJJfy48LmNvIvIR7Y8HLZcXCoiUm0oS9MC fiviIq5I+a8vwai3fSq9JNxYkdo0NGmw/wGrDiZXb1V4+MyeNa5V7ZOAMvaPSrWWDQU5 emGUNpgqvHt3A4e+GMLcxuFAFX9xzztPLPbqnNIvMiXW9whRM3sLrUwx+DXHtazQmOU/ 8xQ1x4YNiCunYQUO6rtEg19j8VhYv5S5O4i2iPYJzQYVq026COon2fI56Xr2B4hqiFDY i7Vb8FdX0ldNcH548El6ADmtnqPDWzI0aPmx7pkzUMzxAr+0u8IrZaSBtIh1CD2ibGGc G21g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linbit-com.20210112.gappssmtp.com header.s=20210112 header.b=agmJAUC8; 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 na10-20020a17090b4c0a00b001f571f6b3d7si8054188pjb.181.2022.08.19.08.40.36; Fri, 19 Aug 2022 08:40:47 -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=@linbit-com.20210112.gappssmtp.com header.s=20210112 header.b=agmJAUC8; 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 S1349706AbiHSPY4 (ORCPT + 99 others); Fri, 19 Aug 2022 11:24:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349694AbiHSPYy (ORCPT ); Fri, 19 Aug 2022 11:24:54 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C52D876AE for ; Fri, 19 Aug 2022 08:24:53 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id w19so9427369ejc.7 for ; Fri, 19 Aug 2022 08:24:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=QcjuSMkjgvmcMVSZtEnP4HKDq1IJJzuLOO5WZsbK0+U=; b=agmJAUC8jfOsl/gS4hT8lv5H6fTz01qf2pe3Iv5R9j9Ate9ewR22RfAhjEhwJ6X7ah 6i2gUSjqWAQUwG7vDL22TL3OJ2DhWyK4iGyCxaZDkZBo8C5fdnjLhkpYDW7Sa1kKJ0m9 nTTLPu80zYWs5VKFI/soqsQZ2m3SZwMJLkyAN+lFaM/+QA0zpsdobhOAVHSxJY09NVpJ unBTEPM3BaQo8lZAI/3LxHBqdI4Xtjfj+l91HslXfgpBHq8BMYj8CpA31LlMMIn6dSW8 vv42Aj7Ht2909aymuONX4UFmgeVzYDTPM0HNunn/RXfrH17hgsFeGl4AuF4WAgPFBbnL B9iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=QcjuSMkjgvmcMVSZtEnP4HKDq1IJJzuLOO5WZsbK0+U=; b=vmVOWZafMjrGB4vLfGgT7nacH6YRQeavyPEh63+m6Fr1A6aM3gruu5pXWPBUKioRKo lbz8PRhKAtMsDA8s2NEgUpPIbNqE01tmHFrC1Ya8bdx1n+nfoOFtKJq+PzyALqr7PgyZ 1gK0ZNI6UK0Xh7MKtL0qAKkxKdqMftT2y4nL0S3/t1U35fBbOEXfvkSu3eVS74BqPgqx A6W0IdS6HUiorxnvFtsE6935YTercuJ73INxIM5XldDnE663GzCfVWLd+47/haBP/SlT erhelZngd83WkYrwg5VU2SwYFV1hsz75RIG7zDGMerawj6RI6h56HqEwDqWrsowm+93q mGUw== X-Gm-Message-State: ACgBeo1WubusIeimlt4uqY9eTSTLjqaIqox1/9a+WX03Cc0ePlp8xKAT 0fGIiSNlpEP/9SzD+5yvdXrGdg== X-Received: by 2002:a17:907:7fa5:b0:730:5d54:4c24 with SMTP id qk37-20020a1709077fa500b007305d544c24mr5248538ejc.641.1660922691995; Fri, 19 Aug 2022 08:24:51 -0700 (PDT) Received: from [192.168.178.55] (h082218028181.host.wavenet.at. [82.218.28.181]) by smtp.gmail.com with ESMTPSA id h10-20020aa7c60a000000b0043cc2c9f5adsm3270313edq.40.2022.08.19.08.24.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Aug 2022 08:24:51 -0700 (PDT) Message-ID: Date: Fri, 19 Aug 2022 17:24:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH] block: move from strlcpy with unused retval to strscpy Content-Language: en-US To: Wolfram Sang Cc: Jens Axboe , Philipp Reisner , Lars Ellenberg , Geoff Levand , Jim Paris , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Minchan Kim , Nitin Gupta , Sergey Senozhatsky , linux-block@vger.kernel.org, drbd-dev@lists.linbit.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20220818205958.6552-1-wsa+renesas@sang-engineering.com> From: =?UTF-8?Q?Christoph_B=c3=b6hmwalder?= In-Reply-To: <20220818205958.6552-1-wsa+renesas@sang-engineering.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Am 18.08.22 um 22:59 schrieb Wolfram Sang: > 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 > --- > drivers/block/brd.c | 2 +- > drivers/block/drbd/drbd_nl.c | 2 +- For the drbd part: Acked-by: Christoph Böhmwalder > drivers/block/mtip32xx/mtip32xx.c | 12 ++++++------ > drivers/block/ps3vram.c | 2 +- > drivers/block/zram/zram_drv.c | 6 +++--- > 5 files changed, 12 insertions(+), 12 deletions(-) ... > diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c > index 013d355a2033..864c98e74875 100644 > --- a/drivers/block/drbd/drbd_nl.c > +++ b/drivers/block/drbd/drbd_nl.c > @@ -4752,7 +4752,7 @@ void notify_helper(enum drbd_notification_type type, > struct drbd_genlmsghdr *dh; > int err; > > - strlcpy(helper_info.helper_name, name, sizeof(helper_info.helper_name)); > + strscpy(helper_info.helper_name, name, sizeof(helper_info.helper_name)); > helper_info.helper_name_len = min(strlen(name), sizeof(helper_info.helper_name)); > helper_info.helper_status = status; > -- Christoph Böhmwalder LINBIT | Keeping the Digital World Running DRBD HA — Disaster Recovery — Software defined Storage