orangefs: use ssize_t instead of size_t for error codes...
Subsystems (2)
PATCH 1/1 orangefs: use ssize_t instead of size_t for error codes...
From: Mike Marshall <[email protected]>
strscpy can return size or errno.
--- fs/orangefs/orangefs-debugfs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
fs/orangefs/orangefs-debugfs.c +6 -4
@@ -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(
Signature · 1 line
2.55.0
Quoted 1 line · On Tue, 15 Sep 2026 12:30:25 -0400, [email protected] wrote:
orangefs: use
ssize_tinstead ofsize_tfor error codes...
Applied to the vfs-7.4.misc branch of the vfs/vfs.git tree. Patches in the vfs-7.4.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs-7.4.misc
[1/1] orangefs: use ssize_t instead of size_t for error codes...
https://git.kernel.org/vfs/vfs/c/0129ac825a37