[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <rl77wgelda45zddkutitervzkxd4iip4mxoheglxinqizf4owm@zmub5beyi6x3>
Date: Wed, 26 Mar 2025 12:41:17 -0400
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: Alan Huang <mmpgouride@...il.com>
Cc: Bharadwaj Raju <bharadwaj.raju777@...il.com>,
Roxana Nicolescu <nicolescu.roxana@...tonmail.com>, linux-bcachefs@...r.kernel.org, linux-kernel@...r.kernel.org,
skhan@...uxfoundation.org, linux-kernel-mentees@...ts.linux.dev
Subject: Re: [PATCH] bcachefs: replace deprecated strncpy() with strscpy()
On Thu, Mar 27, 2025 at 12:36:25AM +0800, Alan Huang wrote:
> On Mar 27, 2025, at 00:17, Kent Overstreet <kent.overstreet@...ux.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@...ux.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 :)
I'll take that patch :)
Powered by blists - more mailing lists