All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Marcelo Moreira <marcelomoreira1905@gmail.com>
Cc: linux-nvme@lists.infradead.org, hch@lst.de, sagi@grimberg.me,
	kch@nvidia.com, skhan@linuxfoundation.org,
	linux-kernel-mentees@lists.linuxfoundation.org,
	~lkcamp/patches@lists.sr.ht
Subject: Re: [PATCH] nvmet: replace strncpy with strscpy
Date: Thu, 3 Apr 2025 06:27:37 +0200	[thread overview]
Message-ID: <20250403042737.GE22360@lst.de> (raw)
In-Reply-To: <20250401004748.29172-1-marcelomoreira1905@gmail.com>

On Mon, Mar 31, 2025 at 09:47:28PM -0300, Marcelo Moreira wrote:
> strncpy() is deprecated due to its lack of NULL-termination
> guarantees and unnecessary zero-padding of the destination buffer.
> Use strscpy() instead.

Nothing explains here why it is deprecated and why the replacement
is better.  And why using memcpy or a seq_buf wasn't considered.

> Link: https://github.com/KSPP/linux/issues/90

And these kinds of links are actively harmful as the point a
commercial entity that can be taken down or changed at any time.
Don't do that.


      reply	other threads:[~2025-04-03  4:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01  0:47 [PATCH] nvmet: replace strncpy with strscpy Marcelo Moreira
2025-04-03  4:27 ` Christoph Hellwig [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=20250403042737.GE22360@lst.de \
    --to=hch@lst.de \
    --cc=kch@nvidia.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=marcelomoreira1905@gmail.com \
    --cc=sagi@grimberg.me \
    --cc=skhan@linuxfoundation.org \
    --cc=~lkcamp/patches@lists.sr.ht \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.