Skip to contentSkip to conversation

ceph: exchange hardcoded value on NAME_MAX

PATCH Applied Viacheslav Dubeyko 3 participants 3 messages Jan 24, 2025 – Jan 27, 2025

Subsystems (2)
lore
Share & tools
lore

Viacheslav Dubeyko

author maintainer
#0 lore raw

PATCH 1/1 ceph: exchange hardcoded value on NAME_MAX

From: Viacheslav Dubeyko <[email protected]>

Initially, ceph_fs_debugfs_init() had temporary name buffer with hardcoded length of 80 symbols. Then, it was hardcoded again for 100 symbols. Finally, it makes sense to exchange hardcoded value on properly defined constant and 255 symbols should be enough for any name case.

---
 fs/ceph/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/debugfs.c +1 -1
index fdf9dc15eafa..fdd404fc8112 100644
@@ -412,7 +412,7 @@ void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
 
 void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
 {
-	char name[100];
+	char name[NAME_MAX];
 
 	doutc(fsc->client, "begin\n");
 	fsc->debugfs_congestion_kb =
Signature · 1 line
2.48.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines · Viacheslav Dubeyko

From: Viacheslav Dubeyko <[email protected]>

Initially, ceph_fs_debugfs_init() had temporary name buffer with hardcoded length of 80 symbols. Then, it was hardcoded again for 100 symbols. Finally, it makes sense to exchange hardcoded value on properly defined constant and 255 symbols should be enough for any name case.

---
 fs/ceph/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/debugfs.c +1 -2
index fdf9dc15eafa..fdd404fc8112 100644
@@ -412,7 +412,7 @@ void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
 
 void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
 {
-       char name[100];
+       char name[NAME_MAX];
 
        doutc(fsc->client, "begin\n");
        fsc->debugfs_congestion_kb =
--
Quoted 3 lines

2.48.0

Signature · 5 lines
Patrick Donnelly, Ph.D.
He / Him / His
Red Hat Partner Engineer
IBM, Inc.
GPG: 19F28A586F808C2402351B93C3301A3E258DD79D
maintainer Applied
#2 lore raw
Quoted 28 lines · Patrick Donnelly
Quoted 26 lines · Viacheslav Dubeyko

From: Viacheslav Dubeyko <[email protected]>

Initially, ceph_fs_debugfs_init() had temporary name buffer with hardcoded length of 80 symbols. Then, it was hardcoded again for 100 symbols. Finally, it makes sense to exchange hardcoded value on properly defined constant and 255 symbols should be enough for any name case.

---
 fs/ceph/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/debugfs.c +1 -1
index fdf9dc15eafa..fdd404fc8112 100644
@@ -412,7 +412,7 @@ void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
 
 void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
 {
-       char name[100];
+       char name[NAME_MAX];
 
Quoted 8 lines
Quoted 6 lines
fs/ceph/debugfs.c +0 -1
        doutc(fsc->client, "begin\n");
        fsc->debugfs_congestion_kb =
--

2.48.0

Applied.

Thanks,

Ilya