[hch-block:blkdev.h-includes 15/16] drivers/md/dm-verity-target.c:101:21: error: variable has incomplete type 'struct scatterlist'

From: kernel test robot
Date: Sun Jul 25 2021 - 04:39:41 EST


tree: git://git.infradead.org/users/hch/block.git blkdev.h-includes
head: db08f634bead64da6de80830782f3c339fc41b11
commit: 9571c3f0ec1966546513f3be443b4abe3a7b4666 [15/16] block: move integrity handling out of blkdev.h
config: arm64-buildonly-randconfig-r002-20210725 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c63dbd850182797bc4b76124d08e1c320ab2365d)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
git remote add hch-block git://git.infradead.org/users/hch/block.git
git fetch --no-tags hch-block blkdev.h-includes
git checkout 9571c3f0ec1966546513f3be443b4abe3a7b4666
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/md/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> drivers/md/dm-verity-target.c:101:21: error: variable has incomplete type 'struct scatterlist'
struct scatterlist sg;
^
include/linux/crypto.h:165:8: note: forward declaration of 'struct scatterlist'
struct scatterlist;
^
>> drivers/md/dm-verity-target.c:104:3: error: implicit declaration of function 'sg_init_one' [-Werror,-Wimplicit-function-declaration]
sg_init_one(&sg, data, len);
^
>> drivers/md/dm-verity-target.c:112:4: error: implicit declaration of function 'sg_init_table' [-Werror,-Wimplicit-function-declaration]
sg_init_table(&sg, 1);
^
>> drivers/md/dm-verity-target.c:113:4: error: implicit declaration of function 'sg_set_page' [-Werror,-Wimplicit-function-declaration]
sg_set_page(&sg, vmalloc_to_page(data), this_step, offset_in_page(data));
^
drivers/md/dm-verity-target.c:376:21: error: variable has incomplete type 'struct scatterlist'
struct scatterlist sg;
^
include/linux/crypto.h:165:8: note: forward declaration of 'struct scatterlist'
struct scatterlist;
^
drivers/md/dm-verity-target.c:384:3: error: implicit declaration of function 'sg_init_table' [-Werror,-Wimplicit-function-declaration]
sg_init_table(&sg, 1);
^
drivers/md/dm-verity-target.c:395:3: error: implicit declaration of function 'sg_set_page' [-Werror,-Wimplicit-function-declaration]
sg_set_page(&sg, bv.bv_page, len, bv.bv_offset);
^
7 errors generated.


vim +101 drivers/md/dm-verity-target.c

a4ffc152198efb drivers/md/dm-verity.c Mikulas Patocka 2012-03-28 96
d1ac3ff008fb9a drivers/md/dm-verity-target.c Gilad Ben-Yossef 2017-02-19 97 static int verity_hash_update(struct dm_verity *v, struct ahash_request *req,
d1ac3ff008fb9a drivers/md/dm-verity-target.c Gilad Ben-Yossef 2017-02-19 98 const u8 *data, size_t len,
12f1ffc40a81fe drivers/md/dm-verity-target.c Gilad Ben-Yossef 2017-10-18 99 struct crypto_wait *wait)
d1ac3ff008fb9a drivers/md/dm-verity-target.c Gilad Ben-Yossef 2017-02-19 100 {
d1ac3ff008fb9a drivers/md/dm-verity-target.c Gilad Ben-Yossef 2017-02-19 @101 struct scatterlist sg;
d1ac3ff008fb9a drivers/md/dm-verity-target.c Gilad Ben-Yossef 2017-02-19 102
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 103 if (likely(!is_vmalloc_addr(data))) {
d1ac3ff008fb9a drivers/md/dm-verity-target.c Gilad Ben-Yossef 2017-02-19 @104 sg_init_one(&sg, data, len);
d1ac3ff008fb9a drivers/md/dm-verity-target.c Gilad Ben-Yossef 2017-02-19 105 ahash_request_set_crypt(req, &sg, NULL, len);
12f1ffc40a81fe drivers/md/dm-verity-target.c Gilad Ben-Yossef 2017-10-18 106 return crypto_wait_req(crypto_ahash_update(req), wait);
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 107 } else {
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 108 do {
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 109 int r;
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 110 size_t this_step = min_t(size_t, len, PAGE_SIZE - offset_in_page(data));
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 111 flush_kernel_vmap_range((void *)data, this_step);
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 @112 sg_init_table(&sg, 1);
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 @113 sg_set_page(&sg, vmalloc_to_page(data), this_step, offset_in_page(data));
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 114 ahash_request_set_crypt(req, &sg, NULL, this_step);
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 115 r = crypto_wait_req(crypto_ahash_update(req), wait);
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 116 if (unlikely(r))
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 117 return r;
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 118 data += this_step;
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 119 len -= this_step;
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 120 } while (len);
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 121 return 0;
e4b069e0945fa1 drivers/md/dm-verity-target.c Mikulas Patocka 2018-08-22 122 }
6dbeda3469ced7 drivers/md/dm-verity.c Sami Tolvanen 2015-11-05 123 }
6dbeda3469ced7 drivers/md/dm-verity.c Sami Tolvanen 2015-11-05 124

:::::: The code at line 101 was first introduced by commit
:::::: d1ac3ff008fb9a48f91fc15920b4c8db24c0f03e dm verity: switch to using asynchronous hash crypto API

:::::: TO: Gilad Ben-Yossef <gilad@xxxxxxxxxxxxx>
:::::: CC: Mike Snitzer <snitzer@xxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip