Hi Harshad,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on ext4/dev]
[also build test WARNING on linus/master v5.9-rc5 next-20200918]
[cannot apply to tip/perf/core tytso-fscrypt/master]
[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]
url:
https://github.com/0day-ci/linux/commits/Harshad-Shirwadkar/ext4-add-fast...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
config: arm-randconfig-s031-20200917 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.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.2-201-g24bdaac6-dirty
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> fs/ext4/fast_commit.c:806:36: sparse: sparse: incorrect type in
assignment (different base types) @@ expected restricted __le16 [usertype] ee_len @@
got restricted __le32 [usertype] @@
> fs/ext4/fast_commit.c:806:36: sparse: expected restricted __le16 [usertype]
ee_len
> fs/ext4/fast_commit.c:806:36: sparse: got restricted __le32 [usertype]
#
https://github.com/0day-ci/linux/commit/2384cbfbcf98b789d426c39b458c52adb...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Harshad-Shirwadkar/ext4-add-fast-commits-feature/20200919-085652
git checkout 2384cbfbcf98b789d426c39b458c52adbb36d4f9
vim +806 fs/ext4/fast_commit.c
754
755 /*
756 * Writes updated data ranges for the inode in question. Updates CRC.
757 * Returns 0 on success, error otherwise.
758 */
759 static int ext4_fc_write_data(struct inode *inode, u32 *crc)
760 {
761 ext4_lblk_t old_blk_size, cur_lblk_off, new_blk_size;
762 struct ext4_inode_info *ei = EXT4_I(inode);
763 struct ext4_map_blocks map;
764 struct ext4_fc_add_range fc_ext;
765 struct ext4_fc_del_range lrange;
766 struct ext4_extent *ex;
767 int ret;
768
769 mutex_lock(&ei->i_fc_lock);
770 if (ei->i_fc_lblk_len == 0) {
771 mutex_unlock(&ei->i_fc_lock);
772 return 0;
773 }
774 old_blk_size = ei->i_fc_lblk_start;
775 new_blk_size = ei->i_fc_lblk_start + ei->i_fc_lblk_len - 1;
776 ei->i_fc_lblk_len = 0;
777 mutex_unlock(&ei->i_fc_lock);
778
779 cur_lblk_off = old_blk_size;
780 jbd_debug(1, "%s: will try writing %d to %d for inode %ld\n",
781 __func__, cur_lblk_off, new_blk_size, inode->i_ino);
782
783 while (cur_lblk_off <= new_blk_size) {
784 map.m_lblk = cur_lblk_off;
785 map.m_len = new_blk_size - cur_lblk_off + 1;
786 ret = ext4_map_blocks(NULL, inode, &map, 0);
787 if (ret < 0)
788 return -ECANCELED;
789
790 if (map.m_len == 0) {
791 cur_lblk_off++;
792 continue;
793 }
794
795 if (ret == 0) {
796 lrange.fc_ino = cpu_to_le32(inode->i_ino);
797 lrange.fc_lblk = cpu_to_le32(map.m_lblk);
798 lrange.fc_len = cpu_to_le32(map.m_len);
799 if (!ext4_fc_add_tlv(inode->i_sb, EXT4_FC_TAG_DEL_RANGE,
800 sizeof(lrange), (u8 *)&lrange, crc))
801 return -ENOSPC;
802 } else {
803 fc_ext.fc_ino = cpu_to_le32(inode->i_ino);
804 ex = (struct ext4_extent *)&fc_ext.fc_ex;
805 ex->ee_block = cpu_to_le32(map.m_lblk);
806 ex->ee_len = cpu_to_le32(map.m_len);
807 ext4_ext_store_pblock(ex, map.m_pblk);
808 if (map.m_flags & EXT4_MAP_UNWRITTEN)
809 ext4_ext_mark_unwritten(ex);
810 else
811 ext4_ext_mark_initialized(ex);
812 if (!ext4_fc_add_tlv(inode->i_sb, EXT4_FC_TAG_ADD_RANGE,
813 sizeof(fc_ext), (u8 *)&fc_ext, crc))
814 return -ENOSPC;
815 }
816
817 cur_lblk_off += map.m_len;
818 }
819
820 return 0;
821 }
822
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org