Whamcloud - gitweb
LU-12447 utils: specify correct size for lfs project buffer 84/35284/2
authorWang Shilong <wshilong@ddn.com>
Fri, 21 Jun 2019 06:28:10 +0000 (23:28 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 3 Jul 2019 03:24:10 +0000 (03:24 +0000)
commita7614e22b431ae3f288ab5e393dbac5a0235f5f5
treef52d7a025ecf787cc039d0c1793da7df12564d65
parent4df2ac9ddc717b435773ddf0bbe5c89ac0c9fda0
LU-12447 utils: specify correct size for lfs project buffer

Enviorment:
Fedora release 28 (Twenty Eight)

gcc (GCC) 8.0.1 20180324 (Red Hat 8.0.1-0.20)
Copyright (C) 2018 Free Software Foundation, Inc.

Hit build failure:
lfs_project.c: In function ‘lfs_project_item_alloc’:
lfs_project.c:72:2: error: ‘strncpy’ specified bound 4096
equals destination size [-Werror=stringop-truncation]
  strncpy(lpi->lpi_pathname, pathname, sizeof(lpi->lpi_pathname));
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This patch is back-ported from the following one:
Lustre-commit: ffef6e3271ad1136d3ab1c2ee229b4690a6722a0
Lustre-change: https://review.whamcloud.com/35257

Test-Parameters: trivial testlist=sanity-quota
Change-Id: Ia6429c47391bf503546609ec6a262fe24664bdd4
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Gu Zheng <gzheng@ddn.com>
Reviewed-on: https://review.whamcloud.com/35284
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/lfs_project.c