From: Abdul Rahim <abdul.rahim@myyahoo.com>
To: xiubli@redhat.com, idryomov@gmail.com
Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
Abdul Rahim <abdul.rahim@myyahoo.com>
Subject: [PATCH] Use strscpy() instead of strcpy()
Date: Tue, 12 Nov 2024 03:40:37 +0530 [thread overview]
Message-ID: <20241111221037.92853-1-abdul.rahim@myyahoo.com> (raw)
In-Reply-To: <20241111221037.92853-1-abdul.rahim.ref@myyahoo.com>
strcpy() is generally considered unsafe and use of strscpy() is
recommended [1]
this fixes checkpatch warning:
WARNING: Prefer strscpy over strcpy
Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1]
Signed-off-by: Abdul Rahim <abdul.rahim@myyahoo.com>
---
fs/ceph/export.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ceph/export.c b/fs/ceph/export.c
index 44451749c544..0e5b3c7b3756 100644
--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -452,7 +452,7 @@ static int __get_snap_name(struct dentry *parent, char *name,
goto out;
if (ceph_snap(inode) == CEPH_SNAPDIR) {
if (ceph_snap(dir) == CEPH_NOSNAP) {
- strcpy(name, fsc->mount_options->snapdir_name);
+ strscpy(name, fsc->mount_options->snapdir_name);
err = 0;
}
goto out;
--
2.43.0
next parent reply other threads:[~2024-11-11 22:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20241111221037.92853-1-abdul.rahim.ref@myyahoo.com>
2024-11-11 22:10 ` Abdul Rahim [this message]
2024-11-12 6:21 ` Christophe JAILLET
2024-11-13 20:15 ` Abdul Rahim
2024-11-13 21:28 ` Christophe JAILLET
2024-11-14 9:14 ` Abdul Rahim
2024-11-14 20:53 ` Christophe JAILLET
2024-11-15 11:38 ` Abdul Rahim
2024-11-13 1:06 ` kernel test robot
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=20241111221037.92853-1-abdul.rahim@myyahoo.com \
--to=abdul.rahim@myyahoo.com \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xiubli@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®