Re: [PATCH v6] hfsplus: validate b-tree fork extents at mount and inode read
From: kernel test robot
Date: Tue Sep 22 2026 - 13:47:49 EST
Hi Nguyen,
kernel test robot noticed the following build errors:
[auto build test ERROR on brauner-vfs/vfs.all]
[also build test ERROR on linus/master v7.3-rc4 next-20260921]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Nguyen-Ngoc-Thang/hfsplus-validate-b-tree-fork-extents-at-mount-and-inode-read/20260918-155156
base: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.all
patch link: https://lore.kernel.org/r/20260918085156.920842-1-ngocthang2710.1999%40gmail.com
patch subject: [PATCH v6] hfsplus: validate b-tree fork extents at mount and inode read
config: sparc64-randconfig-1000-20260922 (https://download.01.org/0day-ci/archive/20260923/202609230123.7x3OfA7z-lkp@xxxxxxxxx/config)
compiler: sparc64-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260923/202609230123.7x3OfA7z-lkp@xxxxxxxxx/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609230123.7x3OfA7z-lkp@xxxxxxxxx/
All errors (new ones prefixed by >>):
>> fs/hfsplus/inode.c:562:5: error: conflicting types for 'hfsplus_inode_read_fork'; have 'int(struct inode *, struct hfsplus_fork_raw *)'
562 | int hfsplus_inode_read_fork(struct inode *inode, struct hfsplus_fork_raw *fork)
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/hfsplus/inode.c:22:
fs/hfsplus/hfsplus_fs.h:456:6: note: previous declaration of 'hfsplus_inode_read_fork' with type 'void(struct inode *, struct hfsplus_fork_raw *)'
456 | void hfsplus_inode_read_fork(struct inode *inode,
| ^~~~~~~~~~~~~~~~~~~~~~~
fs/hfsplus/inode.c: In function 'hfsplus_inode_read_fork':
fs/hfsplus/inode.c:571:11: error: implicit declaration of function 'hfsplus_check_fork'; did you mean 'hfsplus_free_fork'? [-Wimplicit-function-declaration]
571 | ret = hfsplus_check_fork(sb, fork->extents, sbi->total_blocks);
| ^~~~~~~~~~~~~~~~~~
| hfsplus_free_fork
In file included from include/asm-generic/bug.h:31,
from arch/sparc/include/asm/bug.h:25,
from include/linux/bug.h:5,
from include/linux/instrumented.h:10,
from include/linux/atomic/atomic-instrumented.h:17,
from include/linux/atomic.h:82,
from include/asm-generic/bitops/lock.h:5,
from arch/sparc/include/asm/bitops_64.h:52,
from arch/sparc/include/asm/bitops.h:5,
from include/linux/bitops.h:67,
from include/linux/bitmap.h:8,
from include/linux/nodemask.h:91,
from include/linux/list_lru.h:12,
from include/linux/fs/super_types.h:7,
from include/linux/fs/super.h:5,
from include/linux/fs.h:5,
from include/linux/highmem.h:5,
from include/linux/bvec.h:10,
from include/linux/blk_types.h:10,
from include/linux/blkdev.h:9,
from fs/hfsplus/inode.c:12:
include/linux/kern_levels.h:5:25: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'u64' {aka 'long long unsigned int'} [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/printk.h:483:25: note: in definition of macro 'printk_index_wrap'
483 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~
include/linux/printk.h:554:9: note: in expansion of macro 'printk'
554 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~
include/linux/kern_levels.h:11:25: note: in expansion of macro 'KERN_SOH'
11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
| ^~~~~~~~
include/linux/printk.h:554:16: note: in expansion of macro 'KERN_ERR'
554 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~
fs/hfsplus/inode.c:573:9: note: in expansion of macro 'pr_err'
573 | pr_err("hfsplus: fork check failed for inode %lu (err=%d)\n", inode->i_ino, ret);
| ^~~~~~
fs/hfsplus/inode.c:574:17: error: 'HFSPLUS_I_CORRUPT_TREE' undeclared (first use in this function)
574 | set_bit(HFSPLUS_I_CORRUPT_TREE, &hip->flags);
| ^~~~~~~~~~~~~~~~~~~~~~
fs/hfsplus/inode.c:574:17: note: each undeclared identifier is reported only once for each function it appears in
fs/hfsplus/inode.c:580:33: error: 'HFSPLUS_EXTENT_LAST_IDX' undeclared (first use in this function)
580 | for (count = 0, i = 0; i <= HFSPLUS_EXTENT_LAST_IDX; i++)
| ^~~~~~~~~~~~~~~~~~~~~~~
vim +562 fs/hfsplus/inode.c
561
> 562 int hfsplus_inode_read_fork(struct inode *inode, struct hfsplus_fork_raw *fork)
563 {
564 struct super_block *sb = inode->i_sb;
565 struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb);
566 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
567 u32 count;
568 int i, ret;
569
570 /* Validate fork extents to catch on-disk corruption early */
571 ret = hfsplus_check_fork(sb, fork->extents, sbi->total_blocks);
572 if (ret) {
573 pr_err("hfsplus: fork check failed for inode %lu (err=%d)\n", inode->i_ino, ret);
574 set_bit(HFSPLUS_I_CORRUPT_TREE, &hip->flags);
575 sb->s_flags |= SB_RDONLY;
576 return ret; /* Return error directly to the caller */
577 }
578
579 memcpy(&hip->first_extents, &fork->extents, sizeof(hfsplus_extent_rec));
580 for (count = 0, i = 0; i <= HFSPLUS_EXTENT_LAST_IDX; i++)
581 count += be32_to_cpu(fork->extents[i].block_count);
582 hip->first_blocks = count;
583 memset(hip->cached_extents, 0, sizeof(hfsplus_extent_rec));
584 hip->cached_start = 0;
585 hip->cached_blocks = 0;
586
587 hip->alloc_blocks = be32_to_cpu(fork->total_blocks);
588 hip->phys_size = inode->i_size = be64_to_cpu(fork->total_size);
589 hip->fs_blocks =
590 (inode->i_size + sb->s_blocksize - 1) >> sb->s_blocksize_bits;
591 inode_set_bytes(inode, hip->fs_blocks << sb->s_blocksize_bits);
592 hip->clump_blocks =
593 be32_to_cpu(fork->clump_size) >> sbi->alloc_blksz_shift;
594 if (!hip->clump_blocks) {
595 hip->clump_blocks = HFSPLUS_IS_RSRC(inode) ?
596 sbi->rsrc_clump_blocks :
597 sbi->data_clump_blocks;
598 }
599
600 return 0;
601 }
602
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki