* [sashal-stable:pending-5.15 599/612] fs/btrfs/file.c:659:41: error: implicit declaration of function 'btrfs_set_inode_full_sync'; did you mean 'btrfs_set_inode_flags'?
@ 2022-10-26 10:04 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-10-26 10:04 UTC (permalink / raw)
To: Sasha Levin; +Cc: oe-kbuild-all
[-- Attachment #1: Type: text/plain, Size: 8171 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git pending-5.15
head: efdac8d6209698a613eb29096ac674163a12e1b0
commit: b8ceff94543ca7123ca192b4cc962c376182bab3 [599/612] btrfs: fix missed extent on fsync after dropping extent maps
config: arc-randconfig-r043-20221025 (attached as .config)
compiler: arceb-elf-gcc (GCC) 12.1.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=b8ceff94543ca7123ca192b4cc962c376182bab3
git remote add sashal-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-stable pending-5.15
git checkout b8ceff94543ca7123ca192b4cc962c376182bab3
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash fs/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
fs/btrfs/file.c: In function 'btrfs_drop_extent_cache':
>> fs/btrfs/file.c:659:41: error: implicit declaration of function 'btrfs_set_inode_full_sync'; did you mean 'btrfs_set_inode_flags'? [-Werror=implicit-function-declaration]
659 | btrfs_set_inode_full_sync(inode);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| btrfs_set_inode_flags
cc1: some warnings being treated as errors
vim +659 fs/btrfs/file.c
520
521 /*
522 * this drops all the extents in the cache that intersect the range
523 * [start, end]. Existing extents are split as required.
524 */
525 void btrfs_drop_extent_cache(struct btrfs_inode *inode, u64 start, u64 end,
526 int skip_pinned)
527 {
528 struct extent_map *em;
529 struct extent_map *split = NULL;
530 struct extent_map *split2 = NULL;
531 struct extent_map_tree *em_tree = &inode->extent_tree;
532 u64 len = end - start + 1;
533 u64 gen;
534 int ret;
535 int testend = 1;
536 unsigned long flags;
537 int compressed = 0;
538 bool modified;
539
540 WARN_ON(end < start);
541 if (end == (u64)-1) {
542 len = (u64)-1;
543 testend = 0;
544 }
545 while (1) {
546 bool ends_after_range = false;
547 int no_splits = 0;
548
549 modified = false;
550 if (!split)
551 split = alloc_extent_map();
552 if (!split2)
553 split2 = alloc_extent_map();
554 if (!split || !split2)
555 no_splits = 1;
556
557 write_lock(&em_tree->lock);
558 em = lookup_extent_mapping(em_tree, start, len);
559 if (!em) {
560 write_unlock(&em_tree->lock);
561 break;
562 }
563 if (testend && em->start + em->len > start + len)
564 ends_after_range = true;
565 flags = em->flags;
566 gen = em->generation;
567 if (skip_pinned && test_bit(EXTENT_FLAG_PINNED, &em->flags)) {
568 if (ends_after_range) {
569 free_extent_map(em);
570 write_unlock(&em_tree->lock);
571 break;
572 }
573 start = em->start + em->len;
574 if (testend)
575 len = start + len - (em->start + em->len);
576 free_extent_map(em);
577 write_unlock(&em_tree->lock);
578 continue;
579 }
580 compressed = test_bit(EXTENT_FLAG_COMPRESSED, &em->flags);
581 clear_bit(EXTENT_FLAG_PINNED, &em->flags);
582 clear_bit(EXTENT_FLAG_LOGGING, &flags);
583 modified = !list_empty(&em->list);
584 if (no_splits)
585 goto next;
586
587 if (em->start < start) {
588 split->start = em->start;
589 split->len = start - em->start;
590
591 if (em->block_start < EXTENT_MAP_LAST_BYTE) {
592 split->orig_start = em->orig_start;
593 split->block_start = em->block_start;
594
595 if (compressed)
596 split->block_len = em->block_len;
597 else
598 split->block_len = split->len;
599 split->orig_block_len = max(split->block_len,
600 em->orig_block_len);
601 split->ram_bytes = em->ram_bytes;
602 } else {
603 split->orig_start = split->start;
604 split->block_len = 0;
605 split->block_start = em->block_start;
606 split->orig_block_len = 0;
607 split->ram_bytes = split->len;
608 }
609
610 split->generation = gen;
611 split->flags = flags;
612 split->compress_type = em->compress_type;
613 replace_extent_mapping(em_tree, em, split, modified);
614 free_extent_map(split);
615 split = split2;
616 split2 = NULL;
617 }
618 if (ends_after_range) {
619 u64 diff = start + len - em->start;
620
621 split->start = start + len;
622 split->len = em->start + em->len - (start + len);
623 split->flags = flags;
624 split->compress_type = em->compress_type;
625 split->generation = gen;
626
627 if (em->block_start < EXTENT_MAP_LAST_BYTE) {
628 split->orig_block_len = max(em->block_len,
629 em->orig_block_len);
630
631 split->ram_bytes = em->ram_bytes;
632 if (compressed) {
633 split->block_len = em->block_len;
634 split->block_start = em->block_start;
635 split->orig_start = em->orig_start;
636 } else {
637 split->block_len = split->len;
638 split->block_start = em->block_start
639 + diff;
640 split->orig_start = em->orig_start;
641 }
642 } else {
643 split->ram_bytes = split->len;
644 split->orig_start = split->start;
645 split->block_len = 0;
646 split->block_start = em->block_start;
647 split->orig_block_len = 0;
648 }
649
650 if (extent_map_in_tree(em)) {
651 replace_extent_mapping(em_tree, em, split,
652 modified);
653 } else {
654 ret = add_extent_mapping(em_tree, split,
655 modified);
656 /* Logic error, shouldn't happen. */
657 ASSERT(ret == 0);
658 if (WARN_ON(ret != 0) && modified)
> 659 btrfs_set_inode_full_sync(inode);
660 }
661 free_extent_map(split);
662 split = NULL;
663 }
664 next:
665 if (extent_map_in_tree(em)) {
666 /*
667 * If the extent map is still in the tree it means that
668 * either of the following is true:
669 *
670 * 1) It fits entirely in our range (doesn't end beyond
671 * it or starts before it);
672 *
673 * 2) It starts before our range and/or ends after our
674 * range, and we were not able to allocate the extent
675 * maps for split operations, @split and @split2.
676 *
677 * If we are at case 2) then we just remove the entire
678 * extent map - this is fine since if anyone needs it to
679 * access the subranges outside our range, will just
680 * load it again from the subvolume tree's file extent
681 * item. However if the extent map was in the list of
682 * modified extents, then we must mark the inode for a
683 * full fsync, otherwise a fast fsync will miss this
684 * extent if it's new and needs to be logged.
685 */
686 if ((em->start < start || ends_after_range) && modified) {
687 ASSERT(no_splits);
688 btrfs_set_inode_full_sync(inode);
689 }
690 remove_extent_mapping(em_tree, em);
691 }
692 write_unlock(&em_tree->lock);
693
694 /* once for us */
695 free_extent_map(em);
696 /* once for the tree*/
697 free_extent_map(em);
698 }
699 if (split)
700 free_extent_map(split);
701 if (split2)
702 free_extent_map(split2);
703 }
704
--
0-DAY CI Kernel Test Service
https://01.org/lkp
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32431 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-26 10:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 10:04 [sashal-stable:pending-5.15 599/612] fs/btrfs/file.c:659:41: error: implicit declaration of function 'btrfs_set_inode_full_sync'; did you mean 'btrfs_set_inode_flags'? kernel test robot
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.