tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
queue-5.12
head: 6ac90347d410797dff70ea412aacb446f898b366
commit: 9061dbf92469820de013b2dfe17ee85e06c00f6e [89/93] btrfs: zoned: fix parallel
compressed writes
config: arm64-randconfig-r036-20210607 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
d32cc150feb72f315a5bbd34f92e7beca21a50da)
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
#
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable queue-5.12
git checkout 9061dbf92469820de013b2dfe17ee85e06c00f6e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> fs/btrfs/compression.c:406:55: warning: incompatible integer to
pointer conversion passing 'u64' (aka 'unsigned long long') to parameter
of type 'struct extent_map *' [-Wint-conversion]
const bool
use_append = btrfs_use_zone_append(inode, disk_start);
^~~~~~~~~~
fs/btrfs/zoned.h:50:74: note: passing argument to parameter 'em' here
bool btrfs_use_zone_append(struct btrfs_inode *inode, struct extent_map *em);
^
1 warning generated.
vim +406 fs/btrfs/compression.c
379
380 /*
381 * worker function to build and submit bios for previously compressed pages.
382 * The corresponding pages in the inode should be marked for writeback
383 * and the compressed pages should have a reference on them for dropping
384 * when the IO is complete.
385 *
386 * This also checksums the file bytes and gets things ready for
387 * the end io hooks.
388 */
389 blk_status_t btrfs_submit_compressed_write(struct btrfs_inode *inode, u64 start,
390 unsigned long len, u64 disk_start,
391 unsigned long compressed_len,
392 struct page **compressed_pages,
393 unsigned long nr_pages,
394 unsigned int write_flags,
395 struct cgroup_subsys_state *blkcg_css)
396 {
397 struct btrfs_fs_info *fs_info = inode->root->fs_info;
398 struct bio *bio = NULL;
399 struct compressed_bio *cb;
400 unsigned long bytes_left;
401 int pg_index = 0;
402 struct page *page;
403 u64 first_byte = disk_start;
404 blk_status_t ret;
405 int skip_sum = inode->flags & BTRFS_INODE_NODATASUM;
406 const bool use_append = btrfs_use_zone_append(inode,
disk_start);
407 const unsigned int bio_op = use_append ? REQ_OP_ZONE_APPEND :
REQ_OP_WRITE;
408
409 WARN_ON(!PAGE_ALIGNED(start));
410 cb = kmalloc(compressed_bio_size(fs_info, compressed_len), GFP_NOFS);
411 if (!cb)
412 return BLK_STS_RESOURCE;
413 refcount_set(&cb->pending_bios, 0);
414 cb->errors = 0;
415 cb->inode = &inode->vfs_inode;
416 cb->start = start;
417 cb->len = len;
418 cb->mirror_num = 0;
419 cb->compressed_pages = compressed_pages;
420 cb->compressed_len = compressed_len;
421 cb->orig_bio = NULL;
422 cb->nr_pages = nr_pages;
423
424 bio = btrfs_bio_alloc(first_byte);
425 bio->bi_opf = bio_op | write_flags;
426 bio->bi_private = cb;
427 bio->bi_end_io = end_compressed_bio_write;
428
429 if (use_append) {
430 struct extent_map *em;
431 struct map_lookup *map;
432 struct block_device *bdev;
433
434 em = btrfs_get_chunk_map(fs_info, disk_start, PAGE_SIZE);
435 if (IS_ERR(em)) {
436 kfree(cb);
437 bio_put(bio);
438 return BLK_STS_NOTSUPP;
439 }
440
441 map = em->map_lookup;
442 /* We only support single profile for now */
443 ASSERT(map->num_stripes == 1);
444 bdev = map->stripes[0].dev->bdev;
445
446 bio_set_dev(bio, bdev);
447 free_extent_map(em);
448 }
449
450 if (blkcg_css) {
451 bio->bi_opf |= REQ_CGROUP_PUNT;
452 kthread_associate_blkcg(blkcg_css);
453 }
454 refcount_set(&cb->pending_bios, 1);
455
456 /* create and submit bios for the compressed pages */
457 bytes_left = compressed_len;
458 for (pg_index = 0; pg_index < cb->nr_pages; pg_index++) {
459 int submit = 0;
460 int len;
461
462 page = compressed_pages[pg_index];
463 page->mapping = inode->vfs_inode.i_mapping;
464 if (bio->bi_iter.bi_size)
465 submit = btrfs_bio_fits_in_stripe(page, PAGE_SIZE, bio,
466 0);
467
468 if (pg_index == 0 && use_append)
469 len = bio_add_zone_append_page(bio, page, PAGE_SIZE, 0);
470 else
471 len = bio_add_page(bio, page, PAGE_SIZE, 0);
472
473 page->mapping = NULL;
474 if (submit || len < PAGE_SIZE) {
475 /*
476 * inc the count before we submit the bio so
477 * we know the end IO handler won't happen before
478 * we inc the count. Otherwise, the cb might get
479 * freed before we're done setting it up
480 */
481 refcount_inc(&cb->pending_bios);
482 ret = btrfs_bio_wq_end_io(fs_info, bio,
483 BTRFS_WQ_ENDIO_DATA);
484 BUG_ON(ret); /* -ENOMEM */
485
486 if (!skip_sum) {
487 ret = btrfs_csum_one_bio(inode, bio, start, 1);
488 BUG_ON(ret); /* -ENOMEM */
489 }
490
491 ret = btrfs_map_bio(fs_info, bio, 0);
492 if (ret) {
493 bio->bi_status = ret;
494 bio_endio(bio);
495 }
496
497 bio = btrfs_bio_alloc(first_byte);
498 bio->bi_opf = bio_op | write_flags;
499 bio->bi_private = cb;
500 bio->bi_end_io = end_compressed_bio_write;
501 if (blkcg_css)
502 bio->bi_opf |= REQ_CGROUP_PUNT;
503 /*
504 * Use bio_add_page() to ensure the bio has at least one
505 * page.
506 */
507 bio_add_page(bio, page, PAGE_SIZE, 0);
508 }
509 if (bytes_left < PAGE_SIZE) {
510 btrfs_info(fs_info,
511 "bytes left %lu compress len %lu nr %lu",
512 bytes_left, cb->compressed_len, cb->nr_pages);
513 }
514 bytes_left -= PAGE_SIZE;
515 first_byte += PAGE_SIZE;
516 cond_resched();
517 }
518
519 ret = btrfs_bio_wq_end_io(fs_info, bio, BTRFS_WQ_ENDIO_DATA);
520 BUG_ON(ret); /* -ENOMEM */
521
522 if (!skip_sum) {
523 ret = btrfs_csum_one_bio(inode, bio, start, 1);
524 BUG_ON(ret); /* -ENOMEM */
525 }
526
527 ret = btrfs_map_bio(fs_info, bio, 0);
528 if (ret) {
529 bio->bi_status = ret;
530 bio_endio(bio);
531 }
532
533 if (blkcg_css)
534 kthread_associate_blkcg(NULL);
535
536 return 0;
537 }
538
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org