* [GIT PULL] orangefs changes for 7.0
@ 2026-02-10 22:41 Mike Marshall
2026-02-12 17:27 ` Linus Torvalds
2026-02-12 19:14 ` pr-tracker-bot
0 siblings, 2 replies; 3+ messages in thread
From: Mike Marshall @ 2026-02-10 22:41 UTC (permalink / raw)
To: Linus Torvalds, linux-fsdevel, Mike Marshall
The following changes since commit 24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7:
Linux 6.19-rc6 (2026-01-18 15:42:45 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux.git
tags/for-linus-7.0-ofs1
for you to fetch changes up to 9e835108a9ae1c37aef52a6f8d53265f474904a1:
fs/orangefs: Replace deprecated strcpy with memcpy + strscpy
(2026-01-19 16:00:59 -0500)
----------------------------------------------------------------
orangefs: fixes for string handling in orangefs-debugfs.c and xattr.c,
both sent in by Thorsten Blum.
debugfs - replace strcpy with memcpy where the string lengths are known,
and replace other uses of strcpy with strscpy.
xattr - replace strcpy with strscpy.
----------------------------------------------------------------
Thorsten Blum (2):
orangefs: Replace deprecated strcpy with strscpy
fs/orangefs: Replace deprecated strcpy with memcpy + strscpy
fs/orangefs/orangefs-debugfs.c | 36 +++++++++++++++++++-----------------
fs/orangefs/xattr.c | 12 ++++++------
2 files changed, 25 insertions(+), 23 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [GIT PULL] orangefs changes for 7.0
2026-02-10 22:41 [GIT PULL] orangefs changes for 7.0 Mike Marshall
@ 2026-02-12 17:27 ` Linus Torvalds
2026-02-12 19:14 ` pr-tracker-bot
1 sibling, 0 replies; 3+ messages in thread
From: Linus Torvalds @ 2026-02-12 17:27 UTC (permalink / raw)
To: Mike Marshall, Thorsten Blum; +Cc: linux-fsdevel
On Tue, 10 Feb 2026 at 14:41, Mike Marshall <hubcap@omnibond.com> wrote:
>
> orangefs: fixes for string handling in orangefs-debugfs.c and xattr.c,
> both sent in by Thorsten Blum.
So I've taken this, but I actually think it's done in a particularly ugly way.
The thing is, strscpy() is the only *properly* designed string copying
interface I am aware of, if I say so myself. And dammit, part of that
"properly designed" is that it's actually much easier to use than what
this code does.
The code does "strlen + memcpy + special end handling + different
string strscpy if overflow".
But strscpy() returns the resulting length (or error if overflow), so
it's all kind of pointless. And you don't even have to pass in the
size to strscpy() these days if the destination is an array that the
strscpy() can figure out the size of itself.
In this case, you can't do that size simplification, because you need
one extra byte for the added termination, but you could still just use
the nice sane error handling and the code could have just done
len = strscpy(k_buffer, kernel_debug_string, sizeof(k_buffer)-1);
if (len >= 0) {
// Add annoying termination
k_buffer[len] = '\n';
k_buffer[len+1] = 0;
} else {
strscpy(k_buffer, "none\n");
pr_info("%s: overflow 1!\n", __func__);
}
and look, you're all done.
It's still not *pretty*, because that extra termination logic makes it
all have that "sizeof(k_buffer)-1" thing, but for saner interfaces you
can literally just do
if (unlikely(strscpy(dst, src) < 0))
strscpy(dst, "overflow");
and it's all safe and really easy to read because strscpy() returns an
*error* for overflow (in fact, it doesn't even know the full length,
because it will also stop reading the source string and not overflow
that either!)
And so no 'strlen()' or 'memcpy()' games are necessary, and the above
is actually safe even if the source is modified concurrently (well,
you'll get possibly broken data, but you'll always get a proper
terminated newline because the 'len' is always consistent with what
was copied by strscpy).
So I just want to encourage people to use 'strscpy()' and take
advantage of the very useful return value it has, unlike pretty much
every standard C string function.
Linus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [GIT PULL] orangefs changes for 7.0
2026-02-10 22:41 [GIT PULL] orangefs changes for 7.0 Mike Marshall
2026-02-12 17:27 ` Linus Torvalds
@ 2026-02-12 19:14 ` pr-tracker-bot
1 sibling, 0 replies; 3+ messages in thread
From: pr-tracker-bot @ 2026-02-12 19:14 UTC (permalink / raw)
To: Mike Marshall; +Cc: Linus Torvalds, linux-fsdevel, Mike Marshall
The pull request you sent on Tue, 10 Feb 2026 17:41:43 -0500:
> git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux.git tags/for-linus-7.0-ofs1
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/cf559d9011140087abf84b34871849ee8e305bca
Thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-12 19:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10 22:41 [GIT PULL] orangefs changes for 7.0 Mike Marshall
2026-02-12 17:27 ` Linus Torvalds
2026-02-12 19:14 ` pr-tracker-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox