mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Huang <mmpgouride@gmail.com>
To: Roxana Nicolescu <nicolescu.roxana@protonmail.com>
Cc: kent.overstreet@linux.dev, linux-bcachefs@vger.kernel.org,
	linux-kernel@vger.kernel.org, skhan@linuxfoundation.org,
	linux-kernel-mentees@lists.linux.dev
Subject: Re: [PATCH] bcachefs: replace deprecated strncpy() with strscpy()
Date: Wed, 26 Mar 2025 18:02:31 +0800	[thread overview]
Message-ID: <5F3AB2BC-43DA-47A6-A07A-72540B327D11@gmail.com> (raw)
In-Reply-To: <20250326094449.16473-1-nicolescu.roxana@protonmail.com>

On Mar 26, 2025, at 17:44, Roxana Nicolescu <nicolescu.roxana@protonmail.com> wrote:
> 
> strncpy() is deprecated for NUL-terminated destination buffers. Use
> strscpy() instead.
> 
> Link: https://github.com/KSPP/linux/issues/90
> Signed-off-by: Roxana Nicolescu <nicolescu.roxana@protonmail.com>
> ---
> fs/bcachefs/btree_trans_commit.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/bcachefs/btree_trans_commit.c b/fs/bcachefs/btree_trans_commit.c
> index c4f524b2ca9a..7ab25b425d11 100644
> --- a/fs/bcachefs/btree_trans_commit.c
> +++ b/fs/bcachefs/btree_trans_commit.c
> @@ -364,7 +364,7 @@ static noinline void journal_transaction_name(struct btree_trans *trans)
> struct jset_entry_log *l =
> container_of(entry, struct jset_entry_log, entry);
> 
> - strncpy(l->d, trans->fn, JSET_ENTRY_LOG_U64s * sizeof(u64));
> + strscpy(l->d, trans->fn, JSET_ENTRY_LOG_U64s * sizeof(u64));

The last time I asked Kent about this line, he didn’t want this.

> }
> 
> static inline int btree_key_can_insert(struct btree_trans *trans,
> -- 
> 2.34.1
> 
> 
> 


  reply	other threads:[~2025-03-26 10:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-26  9:44 Roxana Nicolescu
2025-03-26 10:02 ` Alan Huang [this message]
2025-03-26 12:19   ` Kent Overstreet
2025-03-26 14:40     ` Roxana Nicolescu
2025-03-26 14:47       ` Kent Overstreet
2025-03-26 15:49         ` Bharadwaj Raju
2025-03-26 16:17           ` Kent Overstreet
2025-03-26 16:36             ` Alan Huang
2025-03-26 16:41               ` Kent Overstreet
2025-03-26 17:05                 ` Roxana Nicolescu

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=5F3AB2BC-43DA-47A6-A07A-72540B327D11@gmail.com \
    --to=mmpgouride@gmail.com \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-bcachefs@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolescu.roxana@protonmail.com \
    --cc=skhan@linuxfoundation.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®