* [PATCH] orangefs: use ssize_t instead of size_t for error codes...
@ 2026-09-15 16:30 hubcap
0 siblings, 0 replies; only message in thread
From: hubcap @ 2026-09-15 16:30 UTC (permalink / raw)
To: linux-fsdevel; +Cc: Mike Marshall, lkp
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-15 16:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 16:30 [PATCH] orangefs: use ssize_t instead of size_t for error codes hubcap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).