Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3138444pxv; Mon, 12 Jul 2021 10:10:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6h0OgYXRKlW3ETVpoBAUsNmB5hbJ1bhaG+0BTVxbkvC8s7eKDfza8ii7oxHlMLTobpA9B X-Received: by 2002:a05:6602:2bf7:: with SMTP id d23mr29438713ioy.107.1626109816609; Mon, 12 Jul 2021 10:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626109816; cv=none; d=google.com; s=arc-20160816; b=VH+KyEPyG7+RCfrXoppq2pMEk/eHOoQjkuM0Jc6N8KVC/7Rfcz+pC5tgsojpPvuRnH vlAntAppYtLlXSHf96cQiS9a9sf7mHRJv7bT1ZJ1wVJvmcE038jgkE7adQJeJMnZR0eA 9BFKeKHX4fG6rfNSGuZNMbNVaEMxQVRj/zeuQll/yrUT8Tf6MD8qA2AhoeXC1XZU3Cw4 lc2/AgQ5gcLq+l/gFl8sJ5Hpj3OqNe8bKFPhkJdq93VavW20JZuzJnZ8eW+x3ImX5AiL 2+eAk2a6TJ92pXrj4KOlxpDoZZBNe87tWMJyDkerZN3JBQD/QaCMwO16lOge2YHRwts9 qUyA== 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:subject:cc:to:from:date; bh=HoJwEeVzzuxWvOhlNMToJ1hmhkHYmVMZ5c7RZmVl1dA=; b=JCwBNI+cqz6Kp73ImVxHpGO/a8H5H6NNBEVNI1BwpLeUJzJsmRt8rzXThlMwa/X4RD TC4onucX4HfiN9j43ug+iLXuNk36c/5NnTwGKUUW/N5M9lYgKMwgz2VB9FshlZ2HLVL0 7VRUEXMu77iSOUg60s5yWiW5anLYUFlb/XbmomVWYGosuoCOSeFdEsqla8pYlB88j65q Lnpn8xJ1ujXJGFDN+8N6RXpRoVsvW0wmSGOohi5YvlmaRBm7/DzZcwDZp4l4ZEnTO+tG 35jZNDblZn2k7/pCG5f2tfqgs3LMB9srk1t6SOeOgwmhfMyZLAUcyhQqrAsgV0SXfidl y9CA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x6si20160726ilv.59.2021.07.12.10.10.04; Mon, 12 Jul 2021 10:10:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234775AbhGLRMr (ORCPT + 99 others); Mon, 12 Jul 2021 13:12:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:56376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233331AbhGLRMr (ORCPT ); Mon, 12 Jul 2021 13:12:47 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 42F55611CB; Mon, 12 Jul 2021 17:09:58 +0000 (UTC) Date: Mon, 12 Jul 2021 13:09:56 -0400 From: Steven Rostedt To: Chuck Lever III Cc: Linux NFS Mailing List , David Wysochanski , Bruce Fields Subject: Re: [PATCH v2 01/25] NFSD: Fix TP_printk() format specifier in trace_nfsd_dirent() Message-ID: <20210712130956.68a5a29f@gandalf.local.home> In-Reply-To: References: <162083366966.3108.12581818416105328952.stgit@klimt.1015granger.net> <162083370248.3108.7424008399973918267.stgit@klimt.1015granger.net> <20210512122623.79ee0dda@gandalf.local.home> <238C0E2D-C2A4-4578-ADD2-C565B3B99842@oracle.com> <20210513105018.7539996a@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, 12 Jul 2021 15:18:05 +0000 Chuck Lever III wrote: > Hello Steven- > > > On May 13, 2021, at 10:50 AM, Steven Rostedt wrote: > > > > On Wed, 12 May 2021 16:52:05 +0000 > > Chuck Lever III wrote: > > > >> The underlying need is to support non-NUL-terminated C strings. > >> > >> I assumed that since the commentary around 9a6944fee68e claims > >> the proper way to trace C strings is to use __string and friends, > >> and those do not support non-NUL-terminated strings, that such > >> strings are really not first-class citizens. Thus I concluded > >> that my use of '%.*s' was incorrect. > >> > >> Having some __string-style helpers that can deal with such > >> strings would be valuable. > > > > I guess the best I can do is a strncpy version, that will add the '\0' in > > the ring buffer. That way we don't need to save the length as well (length > > would need to be at least 4 bytes, where as '\0' is one). > > > > Something like this? > > I don't see this change in v5.14-rc1. Grumble. I thought this thread was over with the bug fix that was sent, but completely forgot about this change, as I never made it into a real commit. I can add this now, kick off some tests, and grovel to Linus saying that this is unused code, but other code will depend on this, and I want to get it upstream so that it can. -- Steve > > > > I added "__string_len()" and "__assign_str_len()". You use them just like > > __string() and __assign_str() but add a max length that you want to use > > (although, it will always allocate "len" regardless if the string is > > smaller). Then use __get_str() just like you use __string(). > > > > Would something like that work? > > > > -- Steve > >