From: hubcap@kernel.org
To: linux-fsdevel@vger.kernel.org
Cc: Mike Marshall <hubcap@omnibond.com>, lkp@intel.com
Subject: [PATCH] orangefs: use ssize_t instead of size_t for error codes...
Date: Tue, 15 Sep 2026 12:30:25 -0400 [thread overview]
Message-ID: <20260915163027.500798-1-hubcap@kernel.org> (raw)
From: Mike Marshall <hubcap@omnibond.com>
strscpy can return size or errno.
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202604071606.asPgJ8Fk-lkp@intel.com/
---
fs/orangefs/orangefs-debugfs.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/fs/orangefs/orangefs-debugfs.c b/fs/orangefs/orangefs-debugfs.c
index 9f94919a6bc6..fec7c1e864d2 100644
--- a/fs/orangefs/orangefs-debugfs.c
+++ b/fs/orangefs/orangefs-debugfs.c
@@ -238,7 +238,7 @@ void orangefs_debugfs_init(int debug_mask)
static void orangefs_kernel_debug_init(void)
{
static char k_buffer[ORANGEFS_MAX_DEBUG_STRING_LEN] = { };
- size_t len =
+ ssize_t len =
strscpy(k_buffer, kernel_debug_string, sizeof(k_buffer) - 1);
if (len > 0) {
@@ -246,7 +246,8 @@ static void orangefs_kernel_debug_init(void)
k_buffer[len + 1] = '\0';
} else {
strscpy(k_buffer, "none\n");
- pr_info("%s: overflow 1!\n", __func__);
+ if (len <0)
+ pr_info("%s: overflow 1!\n", __func__);
}
debugfs_create_file_aux_num(ORANGEFS_KMOD_DEBUG_FILE, 0444, debug_dir, k_buffer,
@@ -337,7 +338,7 @@ static int help_show(struct seq_file *m, void *v)
static void orangefs_client_debug_init(void)
{
static char c_buffer[ORANGEFS_MAX_DEBUG_STRING_LEN] = { };
- size_t len =
+ ssize_t len =
strscpy(c_buffer, client_debug_string, sizeof(c_buffer) - 1);
if (len > 0) {
@@ -345,7 +346,8 @@ static void orangefs_client_debug_init(void)
c_buffer[len + 1] = '\0';
} else {
strscpy(c_buffer, "none\n");
- pr_info("%s: overflow! 2\n", __func__);
+ if (len <0)
+ pr_info("%s: overflow! 2\n", __func__);
}
client_debug_dentry = debugfs_create_file_aux_num(
--
2.55.0
next reply other threads:[~2026-09-15 16:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 16:30 hubcap [this message]
2026-09-25 14:42 ` [PATCH] orangefs: use ssize_t instead of size_t for error codes Christian Brauner
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=20260915163027.500798-1-hubcap@kernel.org \
--to=hubcap@kernel.org \
--cc=hubcap@omnibond.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=lkp@intel.com \
/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.