RE: [PATCH v3] NFSD: Remove open coding of string copy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Chuck Lever III
> Sent: 16 May 2023 15:11
> 
> > On May 16, 2023, at 5:33 AM, David Laight <David.Laight@xxxxxxxxxx> 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)




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux