From: Alan Huang <mmpgouride@gmail.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Bharadwaj Raju <bharadwaj.raju777@gmail.com>,
Roxana Nicolescu <nicolescu.roxana@protonmail.com>,
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: Thu, 27 Mar 2025 00:36:25 +0800 [thread overview]
Message-ID: <A4568396-D1E1-4D93-851B-FA9CF9804E10@gmail.com> (raw)
In-Reply-To: <vfszytfd66lqj54nmkymhnrdjodylb7l3alxblzixnlzv7kxom@4dji3xuvmknj>
On Mar 27, 2025, at 00:17, Kent Overstreet <kent.overstreet@linux.dev> wrote:
>
> On Wed, Mar 26, 2025 at 09:19:06PM +0530, Bharadwaj Raju wrote:
>> On Wed, Mar 26, 2025 at 8:22 PM Kent Overstreet
>> <kent.overstreet@linux.dev> wrote:
>>> Or better, a new helper: when we're copying to a fixed size buffer we
>>> really want to zero out the rest of the buffer - we don't just want a
>>> single terminating nul.
>>
>> I believe strscpy_pad does this?
>>
>> https://docs.kernel.org/core-api/kernel-api.html#c.strscpy_pad
>
> almost, we don't want the 'required nul termination'; that's a
> requirement at least for disk labels where we need to preserve existing
> behaviour
memcpy_and_pad :)
next prev parent reply other threads:[~2025-03-26 16:36 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
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 [this message]
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=A4568396-D1E1-4D93-851B-FA9CF9804E10@gmail.com \
--to=mmpgouride@gmail.com \
--cc=bharadwaj.raju777@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®