ocfs2-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* Re: [Ocfs2-devel] [PATCH 04/14] ocfs2: move from strlcpy with unused retval to strscpy
       [not found] ` <20220818210123.7637-4-wsa+renesas@sang-engineering.com>
@ 2022-08-21 13:24   ` Joseph Qi via Ocfs2-devel
  0 siblings, 0 replies; only message in thread
From: Joseph Qi via Ocfs2-devel @ 2022-08-21 13:24 UTC (permalink / raw)
  To: Wolfram Sang, linux-kernel, akpm; +Cc: ocfs2-devel



On 8/19/22 5:01 AM, Wolfram Sang wrote:
> Follow the advice of the below link and prefer 'strscpy' in this
> subsystem. Conversion is 1:1 because the return value is not used.
> Generated by a coccinelle script.
> 
> Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
>  fs/ocfs2/stackglue.c | 4 ++--
>  fs/ocfs2/super.c     | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c
> index dd77b7aaabf5..317126261523 100644
> --- a/fs/ocfs2/stackglue.c
> +++ b/fs/ocfs2/stackglue.c
> @@ -334,10 +334,10 @@ int ocfs2_cluster_connect(const char *stack_name,
>  		goto out;
>  	}
>  
> -	strlcpy(new_conn->cc_name, group, GROUP_NAME_MAX + 1);
> +	strscpy(new_conn->cc_name, group, GROUP_NAME_MAX + 1);
>  	new_conn->cc_namelen = grouplen;
>  	if (cluster_name_len)
> -		strlcpy(new_conn->cc_cluster_name, cluster_name,
> +		strscpy(new_conn->cc_cluster_name, cluster_name,
>  			CLUSTER_NAME_MAX + 1);
>  	new_conn->cc_cluster_name_len = cluster_name_len;
>  	new_conn->cc_recovery_handler = recovery_handler;
> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
> index 013a727bd7c8..ec46489b6c7e 100644
> --- a/fs/ocfs2/super.c
> +++ b/fs/ocfs2/super.c
> @@ -2222,7 +2222,7 @@ static int ocfs2_initialize_super(struct super_block *sb,
>  		goto out_journal;
>  	}
>  
> -	strlcpy(osb->vol_label, di->id2.i_super.s_label,
> +	strscpy(osb->vol_label, di->id2.i_super.s_label,
>  		OCFS2_MAX_VOL_LABEL_LEN);
>  	osb->root_blkno = le64_to_cpu(di->id2.i_super.s_root_blkno);
>  	osb->system_dir_blkno = le64_to_cpu(di->id2.i_super.s_system_dir_blkno);

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-21 13:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220818210123.7637-1-wsa+renesas@sang-engineering.com>
     [not found] ` <20220818210123.7637-4-wsa+renesas@sang-engineering.com>
2022-08-21 13:24   ` [Ocfs2-devel] [PATCH 04/14] ocfs2: move from strlcpy with unused retval to strscpy Joseph Qi via Ocfs2-devel

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).