tree:
https://android.googlesource.com/kernel/common android-mainline
head: e94931cb2c0ec3992df6dfe452f2145fc5ad2c74
commit: 21b07a71404e12fa0db9ce79bc0b1b02af5f71d0 [2/5] ANDROID: Incremental fs: Make fill
block an ioctl
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-180-g0558317d-dirty
git checkout 21b07a71404e12fa0db9ce79bc0b1b02af5f71d0
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> fs/incfs/vfs.c:1371:30: sparse: sparse: incorrect type in
assignment (different address spaces) @@ expected struct incfs_fill_block
*usr_fill_block_array @@ got truct incfs_fill_block *usr_fill_block_array @@
> fs/incfs/vfs.c:1371:30: sparse: expected struct incfs_fill_block
*usr_fill_block_array
> fs/incfs/vfs.c:1371:30: sparse: got void [noderef] <asn:1> *
> fs/incfs/vfs.c:1379:70: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const [noderef] <asn:1> *from @@ got const
[noderef] <asn:1> *from @@
> fs/incfs/vfs.c:1379:70: sparse: expected void const [noderef] <asn:1> *from
> fs/incfs/vfs.c:1379:70: sparse: got struct incfs_fill_block *
vim +1371 fs/incfs/vfs.c
1353
1354 static long ioctl_fill_blocks(struct file *f, void __user *arg)
1355 {
1356 struct incfs_fill_blocks __user *usr_fill_blocks = arg;
1357 struct incfs_fill_blocks fill_blocks;
1358 struct incfs_fill_block *usr_fill_block_array;
1359 struct data_file *df = get_incfs_data_file(f);
1360 const ssize_t data_buf_size = 2 * INCFS_DATA_FILE_BLOCK_SIZE;
1361 u8 *data_buf = NULL;
1362 ssize_t error = 0;
1363 int i = 0;
1364
1365 if (!df)
1366 return -EBADF;
1367
1368 if (copy_from_user(&fill_blocks, usr_fill_blocks, sizeof(fill_blocks)))
1369 return -EFAULT;
1370
1371 usr_fill_block_array =
u64_to_user_ptr(fill_blocks.fill_blocks);
1372 data_buf = (u8
*)__get_free_pages(GFP_NOFS, get_order(data_buf_size));
1373 if (!data_buf)
1374 return -ENOMEM;
1375
1376 for (i = 0; i < fill_blocks.count; i++) {
1377 struct incfs_fill_block fill_block = {};
1378
1379 if (copy_from_user(&fill_block,
&usr_fill_block_array[i],
1380 sizeof(fill_block)) > 0) {
1381 error = -EFAULT;
1382 break;
1383 }
1384
1385 if (fill_block.data_len > data_buf_size) {
1386 error = -E2BIG;
1387 break;
1388 }
1389
1390 if (copy_from_user(data_buf, u64_to_user_ptr(fill_block.data),
1391 fill_block.data_len) > 0) {
1392 error = -EFAULT;
1393 break;
1394 }
1395 fill_block.data = 0; /* To make sure nobody uses it. */
1396 if (fill_block.flags & INCFS_BLOCK_FLAGS_HASH) {
1397 error = incfs_process_new_hash_block(df, &fill_block,
1398 data_buf);
1399 } else {
1400 error = incfs_process_new_data_block(df, &fill_block,
1401 data_buf);
1402 }
1403 if (error)
1404 break;
1405 }
1406
1407 if (data_buf)
1408 free_pages((unsigned long)data_buf, get_order(data_buf_size));
1409
1410 /*
1411 * Only report the error if no records were processed, otherwise
1412 * just return how many were processed successfully.
1413 */
1414 if (i == 0)
1415 return error;
1416
1417 return i;
1418 }
1419
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org