From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [sashal-linux-stable:queue-5.12 89/93] fs/btrfs/compression.c:406:55: warning: passing argument 2 of 'btrfs_use_zone_append' makes pointer from integer without a cast
Date: Tue, 08 Jun 2021 13:54:00 +0800 [thread overview]
Message-ID: <202106081354.kq4kiOrl-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 7809 bytes --]
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: mips-randconfig-r031-20210607 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.0
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
# https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/commit/?id=9061dbf92469820de013b2dfe17ee85e06c00f6e
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=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
fs/btrfs/compression.c: In function 'btrfs_submit_compressed_write':
>> fs/btrfs/compression.c:406:55: warning: passing argument 2 of 'btrfs_use_zone_append' makes pointer from integer without a cast [-Wint-conversion]
406 | const bool use_append = btrfs_use_zone_append(inode, disk_start);
| ^~~~~~~~~~
| |
| u64 {aka long long unsigned int}
In file included from fs/btrfs/compression.c:31:
fs/btrfs/zoned.h:50:74: note: expected 'struct extent_map *' but argument is of type 'u64' {aka 'long long unsigned int'}
50 | bool btrfs_use_zone_append(struct btrfs_inode *inode, struct extent_map *em);
| ~~~~~~~~~~~~~~~~~~~^~
vim +/btrfs_use_zone_append +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(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 38766 bytes --]
reply other threads:[~2021-06-08 5:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202106081354.kq4kiOrl-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.