Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1019509pxf; Wed, 7 Apr 2021 17:53:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkwqhFSzaBbluTFV29OsqnNON/aem3avL8seIubWiXenXWnw/7oqjtfiRV0339NKzjq2gd X-Received: by 2002:a17:90a:a891:: with SMTP id h17mr5963632pjq.218.1617843180735; Wed, 07 Apr 2021 17:53:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617843180; cv=none; d=google.com; s=arc-20160816; b=iK6SXZGAI1InJXjDk5jdFCkba/w5ouDaJLtOefaI1mlM+IZYsayn7SutzIU9Fff/yQ rwbQZ09Opz7UxPAdG7tzvHN7Mb0rmKpN7QXOOWc5ieotoXCQOJQct2qfmum3DictPVUY 9JIqKi6sbXdRi5h+T6tyQlssxqg5kFUfbgn3/piYSZ1Jglu5Llidy2O6L2aewMnDGiQe FpNXn3CV6ztAhdxTMFuyiwJtaJWE8FnvSuDIZ3/CQ/zOVFemQB5hoUkTJ2mu9N+cTDAb WBLHZRokYmyrU+vsNCtUvaZ5lGKU2VL+Q7Qx2ywZA+jCKjkPvimMQ6NDviDhpmcP3LrQ Vpvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MUVlio1XF0xJ5WwHqUot/9KNqXrKYvgPFvXuJAO80ug=; b=b1pJxuIm9SiKxCdIooJx+r3W9MJuZjZJFQB/j1+2CtKJtOV0vVs7O4lYvuw5Vzp0Ny IWqrPRL1Q3/cK/MFYas/VjtsPdX8G+y+mnDtY2SH13N1P7iqmHmx9gpumiR3uPIUhMzj /S6HqFplXvVwdrUq/TXE80ymXgZfO4L2v1XV66/3xSu/dgj7CVnhSSjHZNgyk5FLuvXs +Co7urC+eobI68OdK6/FXKc0oc9oG4ZKpF+hJK/xB94Cb6yBn8RqplTRQXL46w5K5Jo0 d3RDr5yyU2Uj12DRjDqJkUpCZszvKPQe3E2EXTcFmOZX4RpYrr/L76GtCpNw134pT45E HOcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="f2r/Gaun"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si24986310pfu.197.2021.04.07.17.52.38; Wed, 07 Apr 2021 17:53:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="f2r/Gaun"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229505AbhDHAwo (ORCPT + 99 others); Wed, 7 Apr 2021 20:52:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:45460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbhDHAwo (ORCPT ); Wed, 7 Apr 2021 20:52:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AE5ED611C1; Thu, 8 Apr 2021 00:52:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617843152; bh=0IqB+o5pa4cpP+r10TYU8b1OpH+60OMa+LdDlFSSCM0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f2r/GaunjIWONcwRT1lMgR7osxHYWBpPEZDHV4yjK3NopxXoDK66FDXcLJnabeevk KSZAt6H6VVm5eToznjaloTdlE0n1lEJ0q1F+7Cwl2b59JrQOXsM8yq5TX6S9C7aebP Ul2EutKg1X9UwTMXc2MF04N2WCuBnTF+F6cQ3y/lD91tFi8CYpAEY8vxtqayzY/sY8 dkdOXu+mRQbGtwaB85nTOqK7J6aWu8AwvxP1ejIN5v8i9SxJEsEPHlbyOHGUYcX2R4 YddI6pEgJ/hgNGk0uE3CmXX8b70Nyjh4pE9IxcpgRzj4s3G/ls75vJWuqJg/WZuaph CKzr5887DS28A== Date: Wed, 7 Apr 2021 17:52:30 -0700 From: Eric Biggers To: Shreeya Patel Cc: tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, chao@kernel.org, krisman@collabora.com, drosen@google.com, yuchao0@huawei.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, kernel@collabora.com, andre.almeida@collabora.com, kernel test robot Subject: Re: [PATCH v7 1/4] fs: unicode: Use strscpy() instead of strncpy() Message-ID: References: <20210407144845.53266-1-shreeya.patel@collabora.com> <20210407144845.53266-2-shreeya.patel@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210407144845.53266-2-shreeya.patel@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Apr 07, 2021 at 08:18:42PM +0530, Shreeya Patel wrote: > The -Wstringop-truncation warning highlights the unintended > uses of the strncpy function that truncate the terminating NULL > character from the source string. > Unlike strncpy(), strscpy() always null-terminates the destination string, > hence use strscpy() instead of strncpy(). This explanation is a bit misleading. It would be clearer to phrase this in terms of fixing how overly-long strings are handled: start returning an error instead of creating a non-null-terminated string. > > Fixes: 9d53690f0d4e5 (unicode: implement higher level API for string handling) There should be quotes around the commit title here. - Eric