Hi Sweet, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on kdave/for-next] [also build test WARNING on linus/master v6.0-rc4 next-20220909] [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/Sweet-Tea-Dorminy/btrfs-add-fscrypt-integration/20220906-101551 base: https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next config: loongarch-randconfig-s051-20220907 compiler: loongarch64-linux-gcc (GCC) 12.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-39-gce1a6720-dirty # https://github.com/intel-lab-lkp/linux/commit/36f8808f448f0ed5f183f9de5a321409fbfbbaf0 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/20220906-101551 git checkout 36f8808f448f0ed5f183f9de5a321409fbfbbaf0 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=loongarch SHELL=/bin/bash fs/crypto/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> fs/crypto/crypto.c:94:34: sparse: sparse: restricted __le64 degrades to integer fs/crypto/crypto.c:94:47: sparse: sparse: restricted __le64 degrades to integer >> fs/crypto/crypto.c:94:30: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le64 [usertype] lblk_num @@ got unsigned long long @@ fs/crypto/crypto.c:94:30: sparse: expected restricted __le64 [usertype] lblk_num fs/crypto/crypto.c:94:30: sparse: got unsigned long long vim +94 fs/crypto/crypto.c 71 72 /* 73 * Generate the IV for the given logical block number within the given file. 74 * For filenames encryption, lblk_num == U64_MAX. 75 * 76 * Keep this in sync with fscrypt_limit_io_blocks(). fscrypt_limit_io_blocks() 77 * needs to know about any IV generation methods where the low bits of IV don't 78 * simply contain the lblk_num (e.g., IV_INO_LBLK_32). 79 */ 80 void fscrypt_generate_iv(union fscrypt_iv *iv, u64 lblk_num, 81 const struct fscrypt_info *ci) 82 { 83 u8 flags = fscrypt_policy_flags(&ci->ci_policy); 84 struct inode *inode = ci->ci_inode; 85 const struct fscrypt_operations *s_cop = inode->i_sb->s_cop; 86 87 memset(iv, 0, ci->ci_mode->ivsize); 88 if (s_cop->get_extent_context && lblk_num != U64_MAX) { 89 size_t extent_offset; 90 union fscrypt_extent_context ctx; 91 int ret = fscrypt_get_extent_context(inode, lblk_num, &ctx, &extent_offset, NULL); 92 WARN_ON_ONCE(ret != 0); 93 memcpy(iv->raw, ctx.v1.iv, ci->ci_mode->ivsize); > 94 iv->lblk_num = iv->lblk_num + cpu_to_le64(extent_offset); 95 return; 96 } 97 98 /* 99 * Filename encryption. For inode-based policies, filenames are 100 * encrypted as though they are lblk 0. 101 */ 102 if (lblk_num == U64_MAX) 103 lblk_num = 0; 104 105 if (flags & FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64) { 106 WARN_ON_ONCE(lblk_num > U32_MAX); 107 WARN_ON_ONCE(inode->i_ino > U32_MAX); 108 lblk_num |= (u64)inode->i_ino << 32; 109 } else if (flags & FSCRYPT_POLICY_FLAG_IV_INO_LBLK_32) { 110 WARN_ON_ONCE(lblk_num > U32_MAX); 111 lblk_num = (u32)(ci->ci_hashed_ino + lblk_num); 112 } else if (flags & FSCRYPT_POLICY_FLAG_DIRECT_KEY) { 113 memcpy(iv->nonce, ci->ci_nonce, FSCRYPT_FILE_NONCE_SIZE); 114 } 115 iv->lblk_num = cpu_to_le64(lblk_num); 116 } 117 -- 0-DAY CI Kernel Test Service https://01.org/lkp