tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 8a039651010897592567f5751c4e706ab794e9c0 commit: 2363088eba2ecccfb643725e4864af73c4226a04 [1484/1484] LoongArch: Allow building with kcov coverage config: loongarch-randconfig-001-20241119 (https://download.01.org/0day-ci/archive/20241119/202411191039.9EY0Nxk9-lkp@i...) compiler: loongarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241119/202411191039.9EY0Nxk9-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202411191039.9EY0Nxk9-lkp@intel.com/
All warnings (new ones prefixed by >>):
In function 'write_hints', inlined from 'dm_cache_write_hints' at drivers/md/dm-cache-metadata.c:1753:6:
drivers/md/dm-cache-metadata.c:1729:9: warning: 'strncpy' specified bound 16 equals destination size [-Wstringop-truncation]
1729 | strncpy(cmd->policy_name, policy_name, sizeof(cmd->policy_name)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/strncpy +1729 drivers/md/dm-cache-metadata.c
4e781b498ee500 Joe Thornber 2016-09-15 1713 4e781b498ee500 Joe Thornber 2016-09-15 1714 /* 4e781b498ee500 Joe Thornber 2016-09-15 1715 * It's quicker to always delete the hint array, and recreate with 4e781b498ee500 Joe Thornber 2016-09-15 1716 * dm_array_new(). 4e781b498ee500 Joe Thornber 2016-09-15 1717 */ 4e781b498ee500 Joe Thornber 2016-09-15 1718 static int write_hints(struct dm_cache_metadata *cmd, struct dm_cache_policy *policy) c6b4fcbad044e6 Joe Thornber 2013-03-01 1719 { c6b4fcbad044e6 Joe Thornber 2013-03-01 1720 int r; c6b4fcbad044e6 Joe Thornber 2013-03-01 1721 size_t hint_size; c6b4fcbad044e6 Joe Thornber 2013-03-01 1722 const char *policy_name = dm_cache_policy_get_name(policy); 86a3238c7b9b75 Heinz Mauelshagen 2023-01-25 1723 const unsigned int *policy_version = dm_cache_policy_get_version(policy); c6b4fcbad044e6 Joe Thornber 2013-03-01 1724 c6b4fcbad044e6 Joe Thornber 2013-03-01 1725 if (!policy_name[0] || c6b4fcbad044e6 Joe Thornber 2013-03-01 1726 (strlen(policy_name) > sizeof(cmd->policy_name) - 1)) c6b4fcbad044e6 Joe Thornber 2013-03-01 1727 return -EINVAL; c6b4fcbad044e6 Joe Thornber 2013-03-01 1728 c6b4fcbad044e6 Joe Thornber 2013-03-01 @1729 strncpy(cmd->policy_name, policy_name, sizeof(cmd->policy_name)); 4e7f506f642963 Mike Snitzer 2013-03-20 1730 memcpy(cmd->policy_version, policy_version, sizeof(cmd->policy_version)); c6b4fcbad044e6 Joe Thornber 2013-03-01 1731 c6b4fcbad044e6 Joe Thornber 2013-03-01 1732 hint_size = dm_cache_policy_get_hint_size(policy); c6b4fcbad044e6 Joe Thornber 2013-03-01 1733 if (!hint_size) c6b4fcbad044e6 Joe Thornber 2013-03-01 1734 return 0; /* short-circuit hints initialization */ c6b4fcbad044e6 Joe Thornber 2013-03-01 1735 cmd->policy_hint_size = hint_size; c6b4fcbad044e6 Joe Thornber 2013-03-01 1736 c6b4fcbad044e6 Joe Thornber 2013-03-01 1737 if (cmd->hint_root) { c6b4fcbad044e6 Joe Thornber 2013-03-01 1738 r = dm_array_del(&cmd->hint_info, cmd->hint_root); c6b4fcbad044e6 Joe Thornber 2013-03-01 1739 if (r) c6b4fcbad044e6 Joe Thornber 2013-03-01 1740 return r; c6b4fcbad044e6 Joe Thornber 2013-03-01 1741 } c6b4fcbad044e6 Joe Thornber 2013-03-01 1742 4e781b498ee500 Joe Thornber 2016-09-15 1743 return dm_array_new(&cmd->hint_info, &cmd->hint_root, c6b4fcbad044e6 Joe Thornber 2013-03-01 1744 from_cblock(cmd->cache_blocks), 4e781b498ee500 Joe Thornber 2016-09-15 1745 get_hint, policy); 0596661f0a16d9 Joe Thornber 2014-04-03 1746 } 0596661f0a16d9 Joe Thornber 2014-04-03 1747
:::::: The code at line 1729 was first introduced by commit :::::: c6b4fcbad044e6fffcc75bba160e720eb8d67d17 dm: add cache target
:::::: TO: Joe Thornber ejt@redhat.com :::::: CC: Alasdair G Kergon agk@redhat.com