Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp363884rdb; Fri, 5 Jan 2024 12:24:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IEavLx+to6Z7jdlJw/aNKduoND2G9E5BjgPz4jgdR2ZwPzMzBoNEZ7fHGk3dbSgA0ye+yzc X-Received: by 2002:a17:907:31c1:b0:a28:9d0b:e5b7 with SMTP id xf1-20020a17090731c100b00a289d0be5b7mr859909ejb.128.1704486295327; Fri, 05 Jan 2024 12:24:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704486295; cv=none; d=google.com; s=arc-20160816; b=K/UdzqJrDBaXUdSwtVXNJuQeD8oc8rbskhy9mTW8e9plTNaqrLGoNNZQSR6PCFAzNz XlUvM+MNJwRv2D/vMUHnbZLAqaXXSsvK/GjJWbcDujxDaq0AX+li9RIPapYuPrXTpjfo md7+nsxshHM7shCeuSYZ1GTrMtjP+8Z1djWEgRda0vRrP+v0A4UK7CWK4SqfL8Gb7g02 thW3Rbw12j/jf3FMis0X3doOEEf3DZBcxNsbfLoQL8cLAyXBmomMhC/SFkn9JUC+lrSk jZ1CIEFu/UCs9DAOeExP+nu9EwLSPKvypYfSoPUgMFpsqaif1kku/vOZlQbhYbmwcZNA p6vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=goP5QMBOF4sEQq6KPeqSZk65HdR0+fn5lRd+99JeKS8=; fh=dexyIFr85AC1no5agZs0Lg5Ae3mpsqO+fDI4pGEMI3E=; b=OCcWV72/NyDXGg0lNzbPCcwhHOM4XkBb9k9os2oq7F9K/YCwYU8t+lD7oJIa6OLxS9 P8KbdO1IwNTHNFqzODDhYXbSeWdj7sRFZf0EwRn84XjjzSUjJCbvzbc652wl9tXtpuVa dwrRFBYIjeTx6hbb9wuQjPJ28EGt86l1OU+xo/ceVzotEpSG/YPQK4sycVuI/IQOTs/8 6u1jDXDCJKz0mpAJD1HumIV+SSbH0zZlPt8EOxaSBBX9A/tYZPHmZsgY8CQsLaSwavr2 jN5T+JhcCun+sW6AyXue5n0boYMPxrqXrULMtVgtJVYooo+oJBIpWsM7OoQzC+L4cfl/ qHQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V9X+Oye8; spf=pass (google.com: domain of linux-kernel+bounces-18323-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id x8-20020a1709064bc800b00a27fb1e91desi889027ejv.213.2024.01.05.12.24.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 12:24:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18323-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V9X+Oye8; spf=pass (google.com: domain of linux-kernel+bounces-18323-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 185751F244FB for ; Fri, 5 Jan 2024 20:24:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EEEE83609A; Fri, 5 Jan 2024 20:24:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="V9X+Oye8" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C43D3608B for ; Fri, 5 Jan 2024 20:24:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 196E1C433C7; Fri, 5 Jan 2024 20:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704486286; bh=1a7qWhc3IkRvMd9r5UgVqn8LxrHXD9LTb10cVXrSdHY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V9X+Oye8z7iu0w0FhhhYTZrfJwWTudlLZKoWWlJ2DeeCV6H1loJsfBnEpixFaw+Gw GzBskTlenX/upnXYUhtpC6KxEOD8KLUBVhiPK45hEOSkbeKbU8OgfHPsGDPWkqUGrC PMpMY0rMLQ9mvxtUAFQLSkzbtve95f4rckMLmrmCxyeQn1bi/OJ43nANLdRa/bd7jV FhnaOMygpMPl+LGZWtIrZGOWJrwqPuABKu3f30cV4ht7zDvhzN+JVjwsdvpllRfiwJ 2GYsgpwd8Ggbs78f2kUXgTYWT6YxUDF5GPEfsLMIEDPZPCT5TZOYtOq/6Lx/SfkyWj tGPYmO7g53SEQ== Date: Fri, 5 Jan 2024 13:24:43 -0700 From: Keith Busch To: Arnd Bergmann Cc: Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Arnd Bergmann , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] nvmet: re-fix tracing strncpy() warning Message-ID: References: <20240103155702.4045835-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240103155702.4045835-1-arnd@kernel.org> On Wed, Jan 03, 2024 at 04:56:55PM +0100, Arnd Bergmann wrote: > @@ -53,8 +53,7 @@ static inline void __assign_req_name(char *name, struct nvmet_req *req) > return; > } > > - strncpy(name, req->ns->device_path, > - min_t(size_t, DISK_NAME_LEN, strlen(req->ns->device_path))); > + strscpy_pad(name, req->ns->device_path, DISK_NAME_LEN); > } I like this one, however Daniel has a different fix for this already staged in nvme-6.8: https://git.infradead.org/nvme.git/commitdiff/8f6c0eec5fad13785fd53a5b3b5f8b97b722a2a3