summaryrefslogtreecommitdiffstats
path: root/fs/orangefs/dcache.c
diff options
context:
space:
mode:
authorXiongfeng Wang <xiongfeng.wang@linaro.org>2018-01-08 13:22:33 +0100
committerMike Marshall <hubcap@omnibond.com>2018-02-06 22:38:12 +0100
commit6bdfb48dae8e1b98735bf9387557298d17510be9 (patch)
tree4545b9afbade85593da6d259f4225e879419d9b9 /fs/orangefs/dcache.c
parentorangefs: make orangefs_make_bad_inode static (diff)
downloadlinux-6bdfb48dae8e1b98735bf9387557298d17510be9.tar.xz
linux-6bdfb48dae8e1b98735bf9387557298d17510be9.zip
orangefs: use correct string length
gcc-8 reports fs/orangefs/dcache.c: In function 'orangefs_d_revalidate': ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified bound 256 equals destination size [-Wstringop-truncation] fs/orangefs/namei.c: In function 'orangefs_rename': ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified bound 256 equals destination size [-Wstringop-truncation] fs/orangefs/super.c: In function 'orangefs_mount': ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified bound 256 equals destination size [-Wstringop-truncation] We need one less byte or call strlcpy() to make it a nul-terminated string. Signed-off-by: Xiongfeng Wang <xiongfeng.wang@linaro.org> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/dcache.c')
-rw-r--r--fs/orangefs/dcache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/orangefs/dcache.c b/fs/orangefs/dcache.c
index ae782df5c063..be06e1532a3b 100644
--- a/fs/orangefs/dcache.c
+++ b/fs/orangefs/dcache.c
@@ -33,7 +33,7 @@ static int orangefs_revalidate_lookup(struct dentry *dentry)
new_op->upcall.req.lookup.parent_refn = parent->refn;
strncpy(new_op->upcall.req.lookup.d_name,
dentry->d_name.name,
- ORANGEFS_NAME_MAX);
+ ORANGEFS_NAME_MAX - 1);
gossip_debug(GOSSIP_DCACHE_DEBUG,
"%s:%s:%d interrupt flag [%d]\n",