Re: [PATCH v2] scsi: target: pin db_root for metadata writes

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all,dev.linux.lists.llvm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-scsi,org.kernel.vger.stable,org.kernel.vger.target-devel
Message-ID <[email protected]>
Hi Runyu,

kernel test robot noticed the following build errors:

[auto build test ERROR on mkp-scsi/for-next]
[also build test ERROR on v7.2]
[cannot apply to linus/master next-20260820]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Runyu-Xiao/scsi-target-pin-db_root-for-metadata-writes/20260818-131442
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
patch link:    https://lore.kernel.org/r/20260818051442.1523210-1-runyu.xiao%40seu.edu.cn
patch subject: [PATCH v2] scsi: target: pin db_root for metadata writes
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20260821/[email protected]/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 935bfc708590c60147a79c7df145bb6e68b1d388)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260821/[email protected]/reproduce)

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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All error/warnings (new ones prefixed by >>):

>> drivers/target/target_core_configfs.c:3757:2: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
    3757 |         strscpy(db_root_stage, DB_ROOT_LEN, DB_ROOT_PREFERRED);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/string.h:111:2: note: expanded from macro 'strscpy'
     111 |         CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/args.h:26:27: note: expanded from macro 'CONCATENATE'
      26 | #define CONCATENATE(a, b) __CONCAT(a, b)
         |                           ^
   include/linux/args.h:25:24: note: expanded from macro '__CONCAT'
      25 | #define __CONCAT(a, b) a ## b
         |                        ^
   <scratch space>:29:1: note: expanded from here
      29 | __strscpy1
         | ^
   include/linux/string.h:80:31: note: expanded from macro '__strscpy1'
      80 |         sized_strscpy(dst, src, size + __must_be_cstr(dst) + __must_be_cstr(src))
         |                                 ~~~~~^~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:3757:2: note: use array indexing to silence this warning
   include/linux/string.h:111:2: note: expanded from macro 'strscpy'
     111 |         CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)
         |         ^
   include/linux/args.h:26:27: note: expanded from macro 'CONCATENATE'
      26 | #define CONCATENATE(a, b) __CONCAT(a, b)
         |                           ^
   include/linux/args.h:25:24: note: expanded from macro '__CONCAT'
      25 | #define __CONCAT(a, b) a ## b
         |                        ^
   <scratch space>:29:1: note: expanded from here
      29 | __strscpy1
         | ^
   include/linux/string.h:80:31: note: expanded from macro '__strscpy1'
      80 |         sized_strscpy(dst, src, size + __must_be_cstr(dst) + __must_be_cstr(src))
         |                                      ^
>> drivers/target/target_core_configfs.c:3757:25: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]
    3757 |         strscpy(db_root_stage, DB_ROOT_LEN, DB_ROOT_PREFERRED);
         |                                ^~~~~~~~~~~
   drivers/target/target_core_internal.h:169:22: note: expanded from macro 'DB_ROOT_LEN'
     169 | #define DB_ROOT_LEN             4096
         |                                 ^~~~
   include/linux/string.h:70:43: note: passing argument to parameter here
      70 | ssize_t sized_strscpy(char *, const char *, size_t);
         |                                           ^
>> drivers/target/target_core_configfs.c:3757:38: error: incompatible pointer to integer conversion passing 'char *' to parameter of type 'size_t' (aka 'unsigned long') [-Wint-conversion]
    3757 |         strscpy(db_root_stage, DB_ROOT_LEN, DB_ROOT_PREFERRED);
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
   drivers/target/target_core_internal.h:171:27: note: expanded from macro 'DB_ROOT_PREFERRED'
     171 | #define DB_ROOT_PREFERRED       "/etc/target"
         |                                 ^
   include/linux/string.h:111:60: note: expanded from macro 'strscpy'
     111 |         CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
   include/linux/string.h:80:26: note: expanded from macro '__strscpy1'
      80 |         sized_strscpy(dst, src, size + __must_be_cstr(dst) + __must_be_cstr(src))
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/string.h:70:51: note: passing argument to parameter here
      70 | ssize_t sized_strscpy(char *, const char *, size_t);
         |                                                   ^
   drivers/target/target_core_configfs.c:3760:3: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
    3760 |                 strscpy(db_root_stage, DB_ROOT_LEN, DB_ROOT_DEFAULT);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/string.h:111:2: note: expanded from macro 'strscpy'
     111 |         CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/args.h:26:27: note: expanded from macro 'CONCATENATE'
      26 | #define CONCATENATE(a, b) __CONCAT(a, b)
         |                           ^
   include/linux/args.h:25:24: note: expanded from macro '__CONCAT'
      25 | #define __CONCAT(a, b) a ## b
         |                        ^
   <scratch space>:30:1: note: expanded from here
      30 | __strscpy1
         | ^
   include/linux/string.h:80:31: note: expanded from macro '__strscpy1'
      80 |         sized_strscpy(dst, src, size + __must_be_cstr(dst) + __must_be_cstr(src))
         |                                 ~~~~~^~~~~~~~~~~~~~~~~~~~~
   drivers/target/target_core_configfs.c:3760:3: note: use array indexing to silence this warning
   include/linux/string.h:111:2: note: expanded from macro 'strscpy'
     111 |         CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)
         |         ^
   include/linux/args.h:26:27: note: expanded from macro 'CONCATENATE'
      26 | #define CONCATENATE(a, b) __CONCAT(a, b)
         |                           ^
   include/linux/args.h:25:24: note: expanded from macro '__CONCAT'
      25 | #define __CONCAT(a, b) a ## b
         |                        ^
   <scratch space>:30:1: note: expanded from here
      30 | __strscpy1
         | ^
   include/linux/string.h:80:31: note: expanded from macro '__strscpy1'
      80 |         sized_strscpy(dst, src, size + __must_be_cstr(dst) + __must_be_cstr(src))
         |                                      ^
   drivers/target/target_core_configfs.c:3760:26: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]
    3760 |                 strscpy(db_root_stage, DB_ROOT_LEN, DB_ROOT_DEFAULT);
         |                                        ^~~~~~~~~~~
   drivers/target/target_core_internal.h:169:22: note: expanded from macro 'DB_ROOT_LEN'
     169 | #define DB_ROOT_LEN             4096
         |                                 ^~~~
   include/linux/string.h:70:43: note: passing argument to parameter here
      70 | ssize_t sized_strscpy(char *, const char *, size_t);
         |                                           ^
   drivers/target/target_core_configfs.c:3760:39: error: incompatible pointer to integer conversion passing 'char *' to parameter of type 'size_t' (aka 'unsigned long') [-Wint-conversion]
    3760 |                 strscpy(db_root_stage, DB_ROOT_LEN, DB_ROOT_DEFAULT);
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
   drivers/target/target_core_internal.h:170:26: note: expanded from macro 'DB_ROOT_DEFAULT'
     170 | #define DB_ROOT_DEFAULT         "/var/target"
         |                                 ^
   include/linux/string.h:111:60: note: expanded from macro 'strscpy'
     111 |         CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
   include/linux/string.h:80:26: note: expanded from macro '__strscpy1'
      80 |         sized_strscpy(dst, src, size + __must_be_cstr(dst) + __must_be_cstr(src))
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/string.h:70:51: note: passing argument to parameter here
      70 | ssize_t sized_strscpy(char *, const char *, size_t);
         |                                                   ^
   2 warnings and 4 errors generated.


vim +3757 drivers/target/target_core_configfs.c

  3751	
  3752	static void target_init_dbroot(void)
  3753	{
  3754		struct path path = {};
  3755		int ret;
  3756	
> 3757		strscpy(db_root_stage, DB_ROOT_LEN, DB_ROOT_PREFERRED);
  3758		ret = target_validate_db_root(db_root_stage, &path);
  3759		if (ret) {
  3760			strscpy(db_root_stage, DB_ROOT_LEN, DB_ROOT_DEFAULT);
  3761			ret = target_validate_db_root(db_root_stage, &path);
  3762			if (ret)
  3763				return;
  3764		}
  3765	
  3766		db_root_path = path;
  3767		strscpy(db_root, db_root_stage);
  3768		pr_debug("Target_Core_ConfigFS: db_root set to %s\n", db_root);
  3769	}
  3770	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.