mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Chuck Lever III' <chuck.lever@oracle.com>
Cc: Azeem Shaikh <azeemshaikh38@gmail.com>,
	Jeff Layton <jlayton@kernel.org>,
	"linux-hardening@vger.kernel.org"
	<linux-hardening@vger.kernel.org>,
	"Linux NFS Mailing List" <linux-nfs@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v3] NFSD: Remove open coding of string copy
Date: Tue, 16 May 2023 14:36:29 +0000	[thread overview]
Message-ID: <6af8294f4a744cfc8bad3de754047b0a@AcuMS.aculab.com> (raw)
In-Reply-To: <63008A50-48CC-4915-88D6-71EA1B289322@oracle.com>

From: Chuck Lever III
> Sent: 16 May 2023 15:11
> 
> > On May 16, 2023, at 5:33 AM, David Laight <David.Laight@ACULAB.COM> wrote:
> >
> > From: Azeem Shaikh
> >> Sent: 15 May 2023 03:41
> >>
> >> Instead of open coding a __dynamic_array(), use the __string() and
> >> __assign_str() helper macros that exist for this kind of use case.
> >
> > Is this actually a dynamic array, or just a char[8] ?
> > On 64 bit copying a short fixed-length string is far better
> > than any kind of dynamic sized allocation.
> 
> I'd prefer to use a string helper, since the netid is a string,
> and this documents the data type better and it is not subject
> to sudden breakage if someone creates a standard netid longer
> than 8 characters.
> 
> The nfsd_cb_setup tracepoint is not in a performance-sensitive
> path.
> 
> In addition, trace consumers should be able to count on the
> string helpers to perform memory copies without overrunning
> either the source or destination buffers... one less source
> of error.

That is an entirely different justification :-)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


      reply	other threads:[~2023-05-16 14:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-15  2:40 Azeem Shaikh
2023-05-15 11:21 ` Jeff Layton
2023-05-15 14:30   ` Azeem Shaikh
2023-05-16  9:33 ` David Laight
2023-05-16 14:10   ` Chuck Lever III
2023-05-16 14:36     ` David Laight [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6af8294f4a744cfc8bad3de754047b0a@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=azeemshaikh38@gmail.com \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®