* [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy
@ 2022-08-18 21:01 Wolfram Sang
2022-08-18 21:01 ` [PATCH 02/14] reiserfs: " Wolfram Sang
` (13 more replies)
0 siblings, 14 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Wolfram Sang, Hans de Goede, linux-fsdevel
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>
---
fs/vboxsf/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c
index d2f6df69f611..1fb8f4df60cb 100644
--- a/fs/vboxsf/super.c
+++ b/fs/vboxsf/super.c
@@ -176,7 +176,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
}
folder_name->size = size;
folder_name->length = size - 1;
- strlcpy(folder_name->string.utf8, fc->source, size);
+ strscpy(folder_name->string.utf8, fc->source, size);
err = vboxsf_map_folder(folder_name, &sbi->root);
kfree(folder_name);
if (err) {
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 02/14] reiserfs: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
@ 2022-08-18 21:01 ` Wolfram Sang
2022-08-18 21:01 ` [PATCH 03/14] proc: " Wolfram Sang
` (12 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Wolfram Sang, reiserfs-devel
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>
---
fs/reiserfs/procfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
index 4a7cb16e9345..3dba8acf4e83 100644
--- a/fs/reiserfs/procfs.c
+++ b/fs/reiserfs/procfs.c
@@ -411,7 +411,7 @@ int reiserfs_proc_info_init(struct super_block *sb)
char *s;
/* Some block devices use /'s */
- strlcpy(b, sb->s_id, BDEVNAME_SIZE);
+ strscpy(b, sb->s_id, BDEVNAME_SIZE);
s = strchr(b, '/');
if (s)
*s = '!';
@@ -441,7 +441,7 @@ int reiserfs_proc_info_done(struct super_block *sb)
char *s;
/* Some block devices use /'s */
- strlcpy(b, sb->s_id, BDEVNAME_SIZE);
+ strscpy(b, sb->s_id, BDEVNAME_SIZE);
s = strchr(b, '/');
if (s)
*s = '!';
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 03/14] proc: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
2022-08-18 21:01 ` [PATCH 02/14] reiserfs: " Wolfram Sang
@ 2022-08-18 21:01 ` Wolfram Sang
2022-08-18 21:01 ` [PATCH 04/14] ocfs2: " Wolfram Sang
` (11 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Wolfram Sang, linux-fsdevel
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>
---
fs/proc/kcore.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index dff921f7ca33..9f61d5d405f5 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -422,7 +422,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
char *notes;
size_t i = 0;
- strlcpy(prpsinfo.pr_psargs, saved_command_line,
+ strscpy(prpsinfo.pr_psargs, saved_command_line,
sizeof(prpsinfo.pr_psargs));
notes = kzalloc(notes_len, GFP_KERNEL);
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 04/14] ocfs2: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
2022-08-18 21:01 ` [PATCH 02/14] reiserfs: " Wolfram Sang
2022-08-18 21:01 ` [PATCH 03/14] proc: " Wolfram Sang
@ 2022-08-18 21:01 ` Wolfram Sang
2022-08-21 13:24 ` [Ocfs2-devel] " Joseph Qi via Ocfs2-devel
2022-08-18 21:01 ` [PATCH 05/14] NFSD: " Wolfram Sang
` (10 subsequent siblings)
13 siblings, 1 reply; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: linux-kernel
Cc: Wolfram Sang, Mark Fasheh, Joel Becker, Joseph Qi, ocfs2-devel
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>
---
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);
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 05/14] NFSD: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
` (2 preceding siblings ...)
2022-08-18 21:01 ` [PATCH 04/14] ocfs2: " Wolfram Sang
@ 2022-08-18 21:01 ` Wolfram Sang
2022-08-18 21:08 ` Chuck Lever III
2022-08-18 21:01 ` [PATCH 06/14] NFS: " Wolfram Sang
` (9 subsequent siblings)
13 siblings, 1 reply; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Wolfram Sang, Chuck Lever, Jeff Layton, linux-nfs
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>
---
fs/nfsd/nfs4idmap.c | 8 ++++----
fs/nfsd/nfs4proc.c | 2 +-
fs/nfsd/nfssvc.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index f92161ce1f97..e70a1a2999b7 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -82,8 +82,8 @@ ent_init(struct cache_head *cnew, struct cache_head *citm)
new->id = itm->id;
new->type = itm->type;
- strlcpy(new->name, itm->name, sizeof(new->name));
- strlcpy(new->authname, itm->authname, sizeof(new->authname));
+ strscpy(new->name, itm->name, sizeof(new->name));
+ strscpy(new->authname, itm->authname, sizeof(new->authname));
}
static void
@@ -548,7 +548,7 @@ idmap_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namelen
return nfserr_badowner;
memcpy(key.name, name, namelen);
key.name[namelen] = '\0';
- strlcpy(key.authname, rqst_authname(rqstp), sizeof(key.authname));
+ strscpy(key.authname, rqst_authname(rqstp), sizeof(key.authname));
ret = idmap_lookup(rqstp, nametoid_lookup, &key, nn->nametoid_cache, &item);
if (ret == -ENOENT)
return nfserr_badowner;
@@ -584,7 +584,7 @@ static __be32 idmap_id_to_name(struct xdr_stream *xdr,
int ret;
struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
- strlcpy(key.authname, rqst_authname(rqstp), sizeof(key.authname));
+ strscpy(key.authname, rqst_authname(rqstp), sizeof(key.authname));
ret = idmap_lookup(rqstp, idtoname_lookup, &key, nn->idtoname_cache, &item);
if (ret == -ENOENT)
return encode_ascii_id(xdr, id);
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index a72ab97f77ef..0437210b9898 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1343,7 +1343,7 @@ static __be32 nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr,
return 0;
}
if (work) {
- strlcpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr) - 1);
+ strscpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr) - 1);
refcount_set(&work->nsui_refcnt, 2);
work->nsui_busy = true;
list_add_tail(&work->nsui_list, &nn->nfsd_ssc_mount_list);
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 4bb5baa17040..bfbd9f672f59 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -799,7 +799,7 @@ nfsd_svc(int nrservs, struct net *net, const struct cred *cred)
if (nrservs == 0 && nn->nfsd_serv == NULL)
goto out;
- strlcpy(nn->nfsd_name, utsname()->nodename,
+ strscpy(nn->nfsd_name, utsname()->nodename,
sizeof(nn->nfsd_name));
error = nfsd_create_serv(net);
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 06/14] NFS: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
` (3 preceding siblings ...)
2022-08-18 21:01 ` [PATCH 05/14] NFSD: " Wolfram Sang
@ 2022-08-18 21:01 ` Wolfram Sang
2022-08-18 21:01 ` [PATCH 07/14] lockd: " Wolfram Sang
` (8 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Wolfram Sang, Trond Myklebust, Anna Schumaker, linux-nfs
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>
---
fs/nfs/nfs4client.c | 2 +-
fs/nfs/nfsroot.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 3c5678aec006..7a5162afa5c0 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -254,7 +254,7 @@ struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init)
goto error;
ip_addr = (const char *)buf;
}
- strlcpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr));
+ strscpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr));
err = nfs_idmap_new(clp);
if (err < 0) {
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index fa148308822c..620329b7e6ae 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -139,7 +139,7 @@ static int __init nfs_root_setup(char *line)
ROOT_DEV = Root_NFS;
if (line[0] == '/' || line[0] == ',' || (line[0] >= '0' && line[0] <= '9')) {
- strlcpy(nfs_root_parms, line, sizeof(nfs_root_parms));
+ strscpy(nfs_root_parms, line, sizeof(nfs_root_parms));
} else {
size_t n = strlen(line) + sizeof(NFS_ROOT) - 1;
if (n >= sizeof(nfs_root_parms))
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 07/14] lockd: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
` (4 preceding siblings ...)
2022-08-18 21:01 ` [PATCH 06/14] NFS: " Wolfram Sang
@ 2022-08-18 21:01 ` Wolfram Sang
2022-08-18 21:01 ` [PATCH 08/14] hostfs: " Wolfram Sang
` (7 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: linux-kernel
Cc: Wolfram Sang, Trond Myklebust, Anna Schumaker, Chuck Lever,
Jeff Layton, linux-nfs
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>
---
fs/lockd/host.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index f802223e71ab..cdc8e12cdac4 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -164,7 +164,7 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni,
host->h_addrbuf = nsm->sm_addrbuf;
host->net = ni->net;
host->h_cred = get_cred(ni->cred);
- strlcpy(host->nodename, utsname()->nodename, sizeof(host->nodename));
+ strscpy(host->nodename, utsname()->nodename, sizeof(host->nodename));
out:
return host;
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 08/14] hostfs: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
` (5 preceding siblings ...)
2022-08-18 21:01 ` [PATCH 07/14] lockd: " Wolfram Sang
@ 2022-08-18 21:01 ` Wolfram Sang
2022-08-18 21:01 ` [Cluster-devel] " Wolfram Sang
` (6 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: linux-kernel
Cc: Wolfram Sang, Richard Weinberger, Anton Ivanov, Johannes Berg, linux-um
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>
---
fs/hostfs/hostfs_kern.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 07881b76d42f..277468783fee 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -103,7 +103,7 @@ static char *__dentry_name(struct dentry *dentry, char *name)
*/
BUG_ON(p + strlen(p) + 1 != name + PATH_MAX);
- strlcpy(name, root, PATH_MAX);
+ strscpy(name, root, PATH_MAX);
if (len > p - name) {
__putname(name);
return NULL;
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 09/14] gfs2: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
@ 2022-08-18 21:01 ` Wolfram Sang
2022-08-18 21:01 ` [PATCH 03/14] proc: " Wolfram Sang
` (12 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: linux-kernel
Cc: Wolfram Sang, Bob Peterson, Andreas Gruenbacher, cluster-devel
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>
---
fs/gfs2/ops_fstype.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index 549879929c84..b57d9bf4b123 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -381,8 +381,8 @@ static int init_names(struct gfs2_sbd *sdp, int silent)
if (!table[0])
table = sdp->sd_vfs->s_id;
- strlcpy(sdp->sd_proto_name, proto, GFS2_FSNAME_LEN);
- strlcpy(sdp->sd_table_name, table, GFS2_FSNAME_LEN);
+ strscpy(sdp->sd_proto_name, proto, GFS2_FSNAME_LEN);
+ strscpy(sdp->sd_table_name, table, GFS2_FSNAME_LEN);
table = sdp->sd_table_name;
while ((table = strchr(table, '/')))
@@ -1439,13 +1439,13 @@ static int gfs2_parse_param(struct fs_context *fc, struct fs_parameter *param)
switch (o) {
case Opt_lockproto:
- strlcpy(args->ar_lockproto, param->string, GFS2_LOCKNAME_LEN);
+ strscpy(args->ar_lockproto, param->string, GFS2_LOCKNAME_LEN);
break;
case Opt_locktable:
- strlcpy(args->ar_locktable, param->string, GFS2_LOCKNAME_LEN);
+ strscpy(args->ar_locktable, param->string, GFS2_LOCKNAME_LEN);
break;
case Opt_hostdata:
- strlcpy(args->ar_hostdata, param->string, GFS2_LOCKNAME_LEN);
+ strscpy(args->ar_hostdata, param->string, GFS2_LOCKNAME_LEN);
break;
case Opt_spectator:
args->ar_spectator = 1;
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Cluster-devel] [PATCH 09/14] gfs2: move from strlcpy with unused retval to strscpy
@ 2022-08-18 21:01 ` Wolfram Sang
0 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: cluster-devel.redhat.com
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 at mail.gmail.com/
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
fs/gfs2/ops_fstype.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index 549879929c84..b57d9bf4b123 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -381,8 +381,8 @@ static int init_names(struct gfs2_sbd *sdp, int silent)
if (!table[0])
table = sdp->sd_vfs->s_id;
- strlcpy(sdp->sd_proto_name, proto, GFS2_FSNAME_LEN);
- strlcpy(sdp->sd_table_name, table, GFS2_FSNAME_LEN);
+ strscpy(sdp->sd_proto_name, proto, GFS2_FSNAME_LEN);
+ strscpy(sdp->sd_table_name, table, GFS2_FSNAME_LEN);
table = sdp->sd_table_name;
while ((table = strchr(table, '/')))
@@ -1439,13 +1439,13 @@ static int gfs2_parse_param(struct fs_context *fc, struct fs_parameter *param)
switch (o) {
case Opt_lockproto:
- strlcpy(args->ar_lockproto, param->string, GFS2_LOCKNAME_LEN);
+ strscpy(args->ar_lockproto, param->string, GFS2_LOCKNAME_LEN);
break;
case Opt_locktable:
- strlcpy(args->ar_locktable, param->string, GFS2_LOCKNAME_LEN);
+ strscpy(args->ar_locktable, param->string, GFS2_LOCKNAME_LEN);
break;
case Opt_hostdata:
- strlcpy(args->ar_hostdata, param->string, GFS2_LOCKNAME_LEN);
+ strscpy(args->ar_hostdata, param->string, GFS2_LOCKNAME_LEN);
break;
case Opt_spectator:
args->ar_spectator = 1;
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 10/14] dlm: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
@ 2022-08-18 21:01 ` Wolfram Sang
2022-08-18 21:01 ` [PATCH 03/14] proc: " Wolfram Sang
` (12 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: linux-kernel
Cc: Wolfram Sang, Christine Caulfield, David Teigland, cluster-devel
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>
---
fs/dlm/config.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index ac8b62106ce0..c15425fe48e3 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -122,9 +122,9 @@ static ssize_t cluster_cluster_name_store(struct config_item *item,
{
struct dlm_cluster *cl = config_item_to_cluster(item);
- strlcpy(dlm_config.ci_cluster_name, buf,
+ strscpy(dlm_config.ci_cluster_name, buf,
sizeof(dlm_config.ci_cluster_name));
- strlcpy(cl->cl_cluster_name, buf, sizeof(cl->cl_cluster_name));
+ strscpy(cl->cl_cluster_name, buf, sizeof(cl->cl_cluster_name));
return len;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Cluster-devel] [PATCH 10/14] dlm: move from strlcpy with unused retval to strscpy
@ 2022-08-18 21:01 ` Wolfram Sang
0 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: cluster-devel.redhat.com
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 at mail.gmail.com/
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
fs/dlm/config.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index ac8b62106ce0..c15425fe48e3 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -122,9 +122,9 @@ static ssize_t cluster_cluster_name_store(struct config_item *item,
{
struct dlm_cluster *cl = config_item_to_cluster(item);
- strlcpy(dlm_config.ci_cluster_name, buf,
+ strscpy(dlm_config.ci_cluster_name, buf,
sizeof(dlm_config.ci_cluster_name));
- strlcpy(cl->cl_cluster_name, buf, sizeof(cl->cl_cluster_name));
+ strscpy(cl->cl_cluster_name, buf, sizeof(cl->cl_cluster_name));
return len;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 11/14] cifs: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
` (8 preceding siblings ...)
2022-08-18 21:01 ` [Cluster-devel] " Wolfram Sang
@ 2022-08-18 21:01 ` Wolfram Sang
2022-08-18 21:01 ` [PATCH 12/14] befs: " Wolfram Sang
` (3 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: linux-kernel
Cc: Wolfram Sang, Steve French, Paulo Alcantara, Ronnie Sahlberg,
Shyam Prasad N, linux-cifs, samba-technical
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>
---
fs/cifs/cifsroot.c | 2 +-
fs/cifs/connect.c | 2 +-
fs/cifs/smb2pdu.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/cifs/cifsroot.c b/fs/cifs/cifsroot.c
index 9e91a5a40aae..56ec1b233f52 100644
--- a/fs/cifs/cifsroot.c
+++ b/fs/cifs/cifsroot.c
@@ -59,7 +59,7 @@ static int __init cifs_root_setup(char *line)
pr_err("Root-CIFS: UNC path too long\n");
return 1;
}
- strlcpy(root_dev, line, len);
+ strscpy(root_dev, line, len);
srvaddr = parse_srvaddr(&line[2], s);
if (*s) {
int n = snprintf(root_opts,
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 9111c025bcb8..3da5da9f16b0 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3994,7 +3994,7 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
}
bcc_ptr += length + 1;
bytes_left -= (length + 1);
- strlcpy(tcon->treeName, tree, sizeof(tcon->treeName));
+ strscpy(tcon->treeName, tree, sizeof(tcon->treeName));
/* mostly informational -- no need to fail on error here */
kfree(tcon->nativeFileSystem);
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 9b31ea946d45..9958b5f1c12f 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1928,7 +1928,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
tcon->capabilities = rsp->Capabilities; /* we keep caps little endian */
tcon->maximal_access = le32_to_cpu(rsp->MaximalAccess);
tcon->tid = le32_to_cpu(rsp->hdr.Id.SyncId.TreeId);
- strlcpy(tcon->treeName, tree, sizeof(tcon->treeName));
+ strscpy(tcon->treeName, tree, sizeof(tcon->treeName));
if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) &&
((tcon->share_flags & SHI1005_FLAGS_DFS) == 0))
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 12/14] befs: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
` (9 preceding siblings ...)
2022-08-18 21:01 ` [PATCH 11/14] cifs: " Wolfram Sang
@ 2022-08-18 21:01 ` Wolfram Sang
2022-08-18 21:01 ` [PATCH 13/14] affs: " Wolfram Sang
` (2 subsequent siblings)
13 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Wolfram Sang, Luis de Bethencourt, Salah Triki
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>
---
fs/befs/btree.c | 2 +-
fs/befs/linuxvfs.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/befs/btree.c b/fs/befs/btree.c
index 1b7e0f7128d6..53b36aa29978 100644
--- a/fs/befs/btree.c
+++ b/fs/befs/btree.c
@@ -500,7 +500,7 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds,
goto error_alloc;
}
- strlcpy(keybuf, keystart, keylen + 1);
+ strscpy(keybuf, keystart, keylen + 1);
*value = fs64_to_cpu(sb, valarray[cur_key]);
*keysize = keylen;
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 32749fcee090..eee9237386e2 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -374,7 +374,7 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino)
if (S_ISLNK(inode->i_mode) && !(befs_ino->i_flags & BEFS_LONG_SYMLINK)){
inode->i_size = 0;
inode->i_blocks = befs_sb->block_size / VFS_BLOCK_SIZE;
- strlcpy(befs_ino->i_data.symlink, raw_inode->data.symlink,
+ strscpy(befs_ino->i_data.symlink, raw_inode->data.symlink,
BEFS_SYMLINK_LEN);
} else {
int num_blks;
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 13/14] affs: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
` (10 preceding siblings ...)
2022-08-18 21:01 ` [PATCH 12/14] befs: " Wolfram Sang
@ 2022-08-18 21:01 ` Wolfram Sang
2022-08-18 21:01 ` [PATCH 14/14] fs: " Wolfram Sang
2022-08-19 9:01 ` [PATCH 01/14] vboxsf: " Hans de Goede
13 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Wolfram Sang, David Sterba, linux-fsdevel
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>
---
fs/affs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/affs/super.c b/fs/affs/super.c
index 4c5f30a83336..58b391446ae1 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -276,7 +276,7 @@ parse_options(char *options, kuid_t *uid, kgid_t *gid, int *mode, int *reserved,
char *vol = match_strdup(&args[0]);
if (!vol)
return 0;
- strlcpy(volume, vol, 32);
+ strscpy(volume, vol, 32);
kfree(vol);
break;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 14/14] fs: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
` (11 preceding siblings ...)
2022-08-18 21:01 ` [PATCH 13/14] affs: " Wolfram Sang
@ 2022-08-18 21:01 ` Wolfram Sang
2022-08-19 9:01 ` [PATCH 01/14] vboxsf: " Hans de Goede
13 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-18 21:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Wolfram Sang, Alexander Viro, linux-fsdevel
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>
---
fs/char_dev.c | 2 +-
fs/super.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/char_dev.c b/fs/char_dev.c
index ba0ded7842a7..c6be63dfef04 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -150,7 +150,7 @@ __register_chrdev_region(unsigned int major, unsigned int baseminor,
cd->major = major;
cd->baseminor = baseminor;
cd->minorct = minorct;
- strlcpy(cd->name, name, sizeof(cd->name));
+ strscpy(cd->name, name, sizeof(cd->name));
if (!prev) {
cd->next = curr;
diff --git a/fs/super.c b/fs/super.c
index 734ed584a946..708569341fe5 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -573,7 +573,7 @@ struct super_block *sget_fc(struct fs_context *fc,
fc->s_fs_info = NULL;
s->s_type = fc->fs_type;
s->s_iflags |= fc->s_iflags;
- strlcpy(s->s_id, s->s_type->name, sizeof(s->s_id));
+ strscpy(s->s_id, s->s_type->name, sizeof(s->s_id));
list_add_tail(&s->s_list, &super_blocks);
hlist_add_head(&s->s_instances, &s->s_type->fs_supers);
spin_unlock(&sb_lock);
@@ -652,7 +652,7 @@ struct super_block *sget(struct file_system_type *type,
return ERR_PTR(err);
}
s->s_type = type;
- strlcpy(s->s_id, type->name, sizeof(s->s_id));
+ strscpy(s->s_id, type->name, sizeof(s->s_id));
list_add_tail(&s->s_list, &super_blocks);
hlist_add_head(&s->s_instances, &type->fs_supers);
spin_unlock(&sb_lock);
--
2.35.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 05/14] NFSD: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 ` [PATCH 05/14] NFSD: " Wolfram Sang
@ 2022-08-18 21:08 ` Chuck Lever III
2022-08-19 5:41 ` Wolfram Sang
0 siblings, 1 reply; 22+ messages in thread
From: Chuck Lever III @ 2022-08-18 21:08 UTC (permalink / raw)
To: Wolfram Sang
Cc: Linux Kernel Mailing List, Jeff Layton, Linux NFS Mailing List
> On Aug 18, 2022, at 5:01 PM, Wolfram Sang <wsa+renesas@sang-engineering.com> 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>
Makes sense.
I think I would like to carry 05 and 07 in the NFSD tree so they
can get some exposure to our test workloads before they are merged.
Is that OK with you?
> ---
> fs/nfsd/nfs4idmap.c | 8 ++++----
> fs/nfsd/nfs4proc.c | 2 +-
> fs/nfsd/nfssvc.c | 2 +-
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
> index f92161ce1f97..e70a1a2999b7 100644
> --- a/fs/nfsd/nfs4idmap.c
> +++ b/fs/nfsd/nfs4idmap.c
> @@ -82,8 +82,8 @@ ent_init(struct cache_head *cnew, struct cache_head *citm)
> new->id = itm->id;
> new->type = itm->type;
>
> - strlcpy(new->name, itm->name, sizeof(new->name));
> - strlcpy(new->authname, itm->authname, sizeof(new->authname));
> + strscpy(new->name, itm->name, sizeof(new->name));
> + strscpy(new->authname, itm->authname, sizeof(new->authname));
> }
>
> static void
> @@ -548,7 +548,7 @@ idmap_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namelen
> return nfserr_badowner;
> memcpy(key.name, name, namelen);
> key.name[namelen] = '\0';
> - strlcpy(key.authname, rqst_authname(rqstp), sizeof(key.authname));
> + strscpy(key.authname, rqst_authname(rqstp), sizeof(key.authname));
> ret = idmap_lookup(rqstp, nametoid_lookup, &key, nn->nametoid_cache, &item);
> if (ret == -ENOENT)
> return nfserr_badowner;
> @@ -584,7 +584,7 @@ static __be32 idmap_id_to_name(struct xdr_stream *xdr,
> int ret;
> struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
>
> - strlcpy(key.authname, rqst_authname(rqstp), sizeof(key.authname));
> + strscpy(key.authname, rqst_authname(rqstp), sizeof(key.authname));
> ret = idmap_lookup(rqstp, idtoname_lookup, &key, nn->idtoname_cache, &item);
> if (ret == -ENOENT)
> return encode_ascii_id(xdr, id);
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index a72ab97f77ef..0437210b9898 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -1343,7 +1343,7 @@ static __be32 nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr,
> return 0;
> }
> if (work) {
> - strlcpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr) - 1);
> + strscpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr) - 1);
> refcount_set(&work->nsui_refcnt, 2);
> work->nsui_busy = true;
> list_add_tail(&work->nsui_list, &nn->nfsd_ssc_mount_list);
> diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
> index 4bb5baa17040..bfbd9f672f59 100644
> --- a/fs/nfsd/nfssvc.c
> +++ b/fs/nfsd/nfssvc.c
> @@ -799,7 +799,7 @@ nfsd_svc(int nrservs, struct net *net, const struct cred *cred)
> if (nrservs == 0 && nn->nfsd_serv == NULL)
> goto out;
>
> - strlcpy(nn->nfsd_name, utsname()->nodename,
> + strscpy(nn->nfsd_name, utsname()->nodename,
> sizeof(nn->nfsd_name));
>
> error = nfsd_create_serv(net);
> --
> 2.35.1
>
--
Chuck Lever
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 05/14] NFSD: move from strlcpy with unused retval to strscpy
2022-08-18 21:08 ` Chuck Lever III
@ 2022-08-19 5:41 ` Wolfram Sang
0 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-19 5:41 UTC (permalink / raw)
To: Chuck Lever III
Cc: Linux Kernel Mailing List, Jeff Layton, Linux NFS Mailing List
[-- Attachment #1: Type: text/plain, Size: 579 bytes --]
> > 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>
>
> Makes sense.
>
> I think I would like to carry 05 and 07 in the NFSD tree so they
> can get some exposure to our test workloads before they are merged.
> Is that OK with you?
Of course!
Thank you.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
` (12 preceding siblings ...)
2022-08-18 21:01 ` [PATCH 14/14] fs: " Wolfram Sang
@ 2022-08-19 9:01 ` Hans de Goede
2022-08-20 8:18 ` Wolfram Sang
13 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2022-08-19 9:01 UTC (permalink / raw)
To: Wolfram Sang, linux-kernel; +Cc: linux-fsdevel
Hi,
On 8/18/22 23:01, 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>
Note you send this one twice. Since I'm not sure which one
will end up getting merged, I'm going to just reply to both...
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> fs/vboxsf/super.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c
> index d2f6df69f611..1fb8f4df60cb 100644
> --- a/fs/vboxsf/super.c
> +++ b/fs/vboxsf/super.c
> @@ -176,7 +176,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
> }
> folder_name->size = size;
> folder_name->length = size - 1;
> - strlcpy(folder_name->string.utf8, fc->source, size);
> + strscpy(folder_name->string.utf8, fc->source, size);
> err = vboxsf_map_folder(folder_name, &sbi->root);
> kfree(folder_name);
> if (err) {
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy
2022-08-19 9:01 ` [PATCH 01/14] vboxsf: " Hans de Goede
@ 2022-08-20 8:18 ` Wolfram Sang
0 siblings, 0 replies; 22+ messages in thread
From: Wolfram Sang @ 2022-08-20 8:18 UTC (permalink / raw)
To: Hans de Goede; +Cc: linux-kernel, linux-fsdevel
[-- Attachment #1: Type: text/plain, Size: 227 bytes --]
> Note you send this one twice. Since I'm not sure which one
> will end up getting merged, I'm going to just reply to both...
Ouch, yes, I sent out all subfolders in fs/ twice. Will fix my scripts,
I am sorry for the noise!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 04/14] ocfs2: move from strlcpy with unused retval to strscpy
2022-08-18 21:01 ` [PATCH 04/14] ocfs2: " Wolfram Sang
@ 2022-08-21 13:24 ` Joseph Qi via Ocfs2-devel
0 siblings, 0 replies; 22+ messages in thread
From: Joseph Qi @ 2022-08-21 13:24 UTC (permalink / raw)
To: Wolfram Sang, linux-kernel, akpm; +Cc: Mark Fasheh, Joel Becker, 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);
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Ocfs2-devel] [PATCH 04/14] ocfs2: move from strlcpy with unused retval to strscpy
@ 2022-08-21 13:24 ` Joseph Qi via Ocfs2-devel
0 siblings, 0 replies; 22+ messages 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] 22+ messages in thread
end of thread, other threads:[~2022-08-21 13:24 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18 21:01 [PATCH 01/14] vboxsf: move from strlcpy with unused retval to strscpy Wolfram Sang
2022-08-18 21:01 ` [PATCH 02/14] reiserfs: " Wolfram Sang
2022-08-18 21:01 ` [PATCH 03/14] proc: " Wolfram Sang
2022-08-18 21:01 ` [PATCH 04/14] ocfs2: " Wolfram Sang
2022-08-21 13:24 ` Joseph Qi
2022-08-21 13:24 ` [Ocfs2-devel] " Joseph Qi via Ocfs2-devel
2022-08-18 21:01 ` [PATCH 05/14] NFSD: " Wolfram Sang
2022-08-18 21:08 ` Chuck Lever III
2022-08-19 5:41 ` Wolfram Sang
2022-08-18 21:01 ` [PATCH 06/14] NFS: " Wolfram Sang
2022-08-18 21:01 ` [PATCH 07/14] lockd: " Wolfram Sang
2022-08-18 21:01 ` [PATCH 08/14] hostfs: " Wolfram Sang
2022-08-18 21:01 ` [PATCH 09/14] gfs2: " Wolfram Sang
2022-08-18 21:01 ` [Cluster-devel] " Wolfram Sang
2022-08-18 21:01 ` [PATCH 10/14] dlm: " Wolfram Sang
2022-08-18 21:01 ` [Cluster-devel] " Wolfram Sang
2022-08-18 21:01 ` [PATCH 11/14] cifs: " Wolfram Sang
2022-08-18 21:01 ` [PATCH 12/14] befs: " Wolfram Sang
2022-08-18 21:01 ` [PATCH 13/14] affs: " Wolfram Sang
2022-08-18 21:01 ` [PATCH 14/14] fs: " Wolfram Sang
2022-08-19 9:01 ` [PATCH 01/14] vboxsf: " Hans de Goede
2022-08-20 8:18 ` Wolfram Sang
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.