[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202507152101.0vyIZZfK-lkp@intel.com>
Date: Tue, 15 Jul 2025 22:08:10 +0800
From: kernel test robot <lkp@...el.com>
To: chuguangqing <chuguangqing@...pur.com>, Theodore Ts'o <tytso@....edu>,
Andreas Dilger <adilger.kernel@...ger.ca>
Cc: oe-kbuild-all@...ts.linux.dev, linux-ext4@...r.kernel.org,
linux-kernel@...r.kernel.org,
chuguangqing <chuguangqing@...pur.com>
Subject: Re: [PATCH 1/1] Add FALLOC_FL_ALLOCATE_RANGE to the set of supported
fallocate mode flags. This change improves code clarity and maintains by
explicitly showing this flag in the supported flags mask.
Hi chuguangqing,
kernel test robot noticed the following build errors:
[auto build test ERROR on next-20250714]
[cannot apply to tytso-ext4/dev v6.16-rc6 v6.16-rc5 v6.16-rc4 linus/master v6.16-rc6]
[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/chuguangqing/Add-FALLOC_FL_ALLOCATE_RANGE-to-the-set-of-supported-fallocate-mode-flags-This-change-improves-code-clarity-and-maintain/20250715-111753
base: next-20250714
patch link: https://lore.kernel.org/r/20250715031531.1693-2-chuguangqing%40inspur.com
patch subject: [PATCH 1/1] Add FALLOC_FL_ALLOCATE_RANGE to the set of supported fallocate mode flags. This change improves code clarity and maintains by explicitly showing this flag in the supported flags mask.
config: arc-randconfig-002-20250715 (https://download.01.org/0day-ci/archive/20250715/202507152101.0vyIZZfK-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250715/202507152101.0vyIZZfK-lkp@intel.com/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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507152101.0vyIZZfK-lkp@intel.com/
All errors (new ones prefixed by >>):
fs/ext4/extents.c: In function 'ext4_fallocate':
>> fs/ext4/extents.c:4787:22: error: 'FALL_C_FL_ALLOCATE_RANGE' undeclared (first use in this function); did you mean 'FALLOC_FL_ALLOCATE_RANGE'?
4787 | if (mode & ~(FALL_C_FL_ALLOCATE_RANGE | FALLOC_FL_KEEP_SIZE |
| ^~~~~~~~~~~~~~~~~~~~~~~~
| FALLOC_FL_ALLOCATE_RANGE
fs/ext4/extents.c:4787:22: note: each undeclared identifier is reported only once for each function it appears in
vim +4787 fs/ext4/extents.c
4755
4756 /*
4757 * preallocate space for a file. This implements ext4's fallocate file
4758 * operation, which gets called from sys_fallocate system call.
4759 * For block-mapped files, posix_fallocate should fall back to the method
4760 * of writing zeroes to the required new blocks (the same behavior which is
4761 * expected for file systems which do not support fallocate() system call).
4762 */
4763 long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
4764 {
4765 struct inode *inode = file_inode(file);
4766 struct address_space *mapping = file->f_mapping;
4767 int ret;
4768
4769 /*
4770 * Encrypted inodes can't handle collapse range or insert
4771 * range since we would need to re-encrypt blocks with a
4772 * different IV or XTS tweak (which are based on the logical
4773 * block number).
4774 */
4775 if (IS_ENCRYPTED(inode) &&
4776 (mode & (FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_INSERT_RANGE)))
4777 return -EOPNOTSUPP;
4778 /*
4779 * Don't allow writing zeroes if the underlying device does not
4780 * enable the unmap write zeroes operation.
4781 */
4782 if ((mode & FALLOC_FL_WRITE_ZEROES) &&
4783 !bdev_write_zeroes_unmap_sectors(inode->i_sb->s_bdev))
4784 return -EOPNOTSUPP;
4785
4786 /* Return error if mode is not supported */
> 4787 if (mode & ~(FALL_C_FL_ALLOCATE_RANGE | FALLOC_FL_KEEP_SIZE |
4788 FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
4789 FALLOC_FL_ZERO_RANGE | FALLOC_FL_INSERT_RANGE))
4790 return -EOPNOTSUPP;
4791
4792 inode_lock(inode);
4793 ret = ext4_convert_inline_data(inode);
4794 if (ret)
4795 goto out_inode_lock;
4796
4797 /* Wait all existing dio workers, newcomers will block on i_rwsem */
4798 inode_dio_wait(inode);
4799
4800 ret = file_modified(file);
4801 if (ret)
4802 goto out_inode_lock;
4803
4804 if ((mode & FALLOC_FL_MODE_MASK) == FALLOC_FL_ALLOCATE_RANGE) {
4805 ret = ext4_do_fallocate(file, offset, len, mode);
4806 goto out_inode_lock;
4807 }
4808
4809 /*
4810 * Follow-up operations will drop page cache, hold invalidate lock
4811 * to prevent page faults from reinstantiating pages we have
4812 * released from page cache.
4813 */
4814 filemap_invalidate_lock(mapping);
4815
4816 ret = ext4_break_layouts(inode);
4817 if (ret)
4818 goto out_invalidate_lock;
4819
4820 switch (mode & FALLOC_FL_MODE_MASK) {
4821 case FALLOC_FL_PUNCH_HOLE:
4822 ret = ext4_punch_hole(file, offset, len);
4823 break;
4824 case FALLOC_FL_COLLAPSE_RANGE:
4825 ret = ext4_collapse_range(file, offset, len);
4826 break;
4827 case FALLOC_FL_INSERT_RANGE:
4828 ret = ext4_insert_range(file, offset, len);
4829 break;
4830 case FALLOC_FL_ZERO_RANGE:
4831 case FALLOC_FL_WRITE_ZEROES:
4832 ret = ext4_zero_range(file, offset, len, mode);
4833 break;
4834 default:
4835 ret = -EOPNOTSUPP;
4836 }
4837
4838 out_invalidate_lock:
4839 filemap_invalidate_unlock(mapping);
4840 out_inode_lock:
4841 inode_unlock(inode);
4842 return ret;
4843 }
4844
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists