Hi Sweet, Thank you for the patch! Yet something to improve: [auto build test ERROR on 698dd8deb7c144616da2bcf2534808931a6bb8e2] url: https://github.com/intel-lab-lkp/linux/commits/Sweet-Tea-Dorminy/btrfs-add-fscrypt-integration/20221102-195609 base: 698dd8deb7c144616da2bcf2534808931a6bb8e2 patch link: https://lore.kernel.org/r/56e36fb5b9530c96adcde5b3b91289bffddd89fd.1667389115.git.sweettea-kernel%40dorminy.me patch subject: [PATCH v5 07/18] btrfs: disable various operations on encrypted inodes config: riscv-rv32_defconfig compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 2bbafe04fe785a9469bea5a3737f8d7d3ce4aca2) 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 riscv cross compiling tool for clang build # apt-get install binutils-riscv-linux-gnu # https://github.com/intel-lab-lkp/linux/commit/b46670f22254a902901f050136039092addb6c46 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Sweet-Tea-Dorminy/btrfs-add-fscrypt-integration/20221102-195609 git checkout b46670f22254a902901f050136039092addb6c46 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash fs/btrfs/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All errors (new ones prefixed by >>): >> fs/btrfs/reflink.c:818:54: error: too many arguments to function call, expected 2, have 3 ret = fscrypt_have_same_policy(inode_in, inode_out, &same); ~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~ include/linux/fscrypt.h:536:19: note: 'fscrypt_have_same_policy' declared here static inline int fscrypt_have_same_policy(struct inode *inode1, ^ 1 error generated. vim +818 fs/btrfs/reflink.c 794 795 static int btrfs_remap_file_range_prep(struct file *file_in, loff_t pos_in, 796 struct file *file_out, loff_t pos_out, 797 loff_t *len, unsigned int remap_flags) 798 { 799 struct inode *inode_in = file_inode(file_in); 800 struct inode *inode_out = file_inode(file_out); 801 u64 bs = BTRFS_I(inode_out)->root->fs_info->sb->s_blocksize; 802 u64 wb_len; 803 int ret; 804 bool same; 805 806 if (!(remap_flags & REMAP_FILE_DEDUP)) { 807 struct btrfs_root *root_out = BTRFS_I(inode_out)->root; 808 809 if (btrfs_root_readonly(root_out)) 810 return -EROFS; 811 812 ASSERT(inode_in->i_sb == inode_out->i_sb); 813 } 814 815 /* 816 * Can only reflink encrypted files if both files are encrypted. 817 */ > 818 ret = fscrypt_have_same_policy(inode_in, inode_out, &same); 819 if (ret) 820 return ret; 821 if (!same) 822 return -EINVAL; 823 824 /* Don't make the dst file partly checksummed */ 825 if ((BTRFS_I(inode_in)->flags & BTRFS_INODE_NODATASUM) != 826 (BTRFS_I(inode_out)->flags & BTRFS_INODE_NODATASUM)) { 827 return -EINVAL; 828 } 829 830 /* 831 * Now that the inodes are locked, we need to start writeback ourselves 832 * and can not rely on the writeback from the VFS's generic helper 833 * generic_remap_file_range_prep() because: 834 * 835 * 1) For compression we must call filemap_fdatawrite_range() range 836 * twice (btrfs_fdatawrite_range() does it for us), and the generic 837 * helper only calls it once; 838 * 839 * 2) filemap_fdatawrite_range(), called by the generic helper only 840 * waits for the writeback to complete, i.e. for IO to be done, and 841 * not for the ordered extents to complete. We need to wait for them 842 * to complete so that new file extent items are in the fs tree. 843 */ 844 if (*len == 0 && !(remap_flags & REMAP_FILE_DEDUP)) 845 wb_len = ALIGN(inode_in->i_size, bs) - ALIGN_DOWN(pos_in, bs); 846 else 847 wb_len = ALIGN(*len, bs); 848 849 /* 850 * Workaround to make sure NOCOW buffered write reach disk as NOCOW. 851 * 852 * Btrfs' back references do not have a block level granularity, they 853 * work at the whole extent level. 854 * NOCOW buffered write without data space reserved may not be able 855 * to fall back to CoW due to lack of data space, thus could cause 856 * data loss. 857 * 858 * Here we take a shortcut by flushing the whole inode, so that all 859 * nocow write should reach disk as nocow before we increase the 860 * reference of the extent. We could do better by only flushing NOCOW 861 * data, but that needs extra accounting. 862 * 863 * Also we don't need to check ASYNC_EXTENT, as async extent will be 864 * CoWed anyway, not affecting nocow part. 865 */ 866 ret = filemap_flush(inode_in->i_mapping); 867 if (ret < 0) 868 return ret; 869 870 ret = btrfs_wait_ordered_range(inode_in, ALIGN_DOWN(pos_in, bs), 871 wb_len); 872 if (ret < 0) 873 return ret; 874 ret = btrfs_wait_ordered_range(inode_out, ALIGN_DOWN(pos_out, bs), 875 wb_len); 876 if (ret < 0) 877 return ret; 878 879 return generic_remap_file_range_prep(file_in, pos_in, file_out, pos_out, 880 len, remap_flags); 881 } 882 -- 0-DAY CI Kernel Test Service https://01.org/lkp