[paragon-software-group-ntfs3:master 8/16] fs/ntfs3/frecord.c:1909:45: sparse: sparse: incorrect type in initializer (different address spaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://github.com/Paragon-Software-Group/linux-ntfs3.git master
head:   7529036a025ad8bbd664f3aad8bd726e664a6db7
commit: afeed485ef9286020da77b400f06894a0fe0ad1a [8/16] fs/ntfs3: Remove '__user' for kernel pointer
config: x86_64-randconfig-123-20240824 (https://download.01.org/0day-ci/archive/20240824/202408240903.7Yk8oU2k-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240824/202408240903.7Yk8oU2k-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/202408240903.7Yk8oU2k-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> fs/ntfs3/frecord.c:1909:45: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct fiemap_extent *dest @@     got struct fiemap_extent [noderef] __user *fi_extents_start @@
   fs/ntfs3/frecord.c:1909:45: sparse:     expected struct fiemap_extent *dest
   fs/ntfs3/frecord.c:1909:45: sparse:     got struct fiemap_extent [noderef] __user *fi_extents_start
   fs/ntfs3/frecord.c:2011:35: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct fiemap_extent [noderef] __user *fi_extents_start @@     got struct fiemap_extent *[assigned] fe_k @@
   fs/ntfs3/frecord.c:2011:35: sparse:     expected struct fiemap_extent [noderef] __user *fi_extents_start
   fs/ntfs3/frecord.c:2011:35: sparse:     got struct fiemap_extent *[assigned] fe_k
   fs/ntfs3/frecord.c: note: in included file:
   fs/ntfs3/ntfs.h:461:21: sparse: sparse: self-comparison always evaluates to false

vim +1909 fs/ntfs3/frecord.c

  1900	
  1901	/*
  1902	 * fiemap_fill_next_extent_k - a copy of fiemap_fill_next_extent
  1903	 * but it accepts kernel address for fi_extents_start
  1904	 */
  1905	static int fiemap_fill_next_extent_k(struct fiemap_extent_info *fieinfo,
  1906					     u64 logical, u64 phys, u64 len, u32 flags)
  1907	{
  1908		struct fiemap_extent extent;
> 1909		struct fiemap_extent *dest = fieinfo->fi_extents_start;
  1910	
  1911		/* only count the extents */
  1912		if (fieinfo->fi_extents_max == 0) {
  1913			fieinfo->fi_extents_mapped++;
  1914			return (flags & FIEMAP_EXTENT_LAST) ? 1 : 0;
  1915		}
  1916	
  1917		if (fieinfo->fi_extents_mapped >= fieinfo->fi_extents_max)
  1918			return 1;
  1919	
  1920		if (flags & FIEMAP_EXTENT_DELALLOC)
  1921			flags |= FIEMAP_EXTENT_UNKNOWN;
  1922		if (flags & FIEMAP_EXTENT_DATA_ENCRYPTED)
  1923			flags |= FIEMAP_EXTENT_ENCODED;
  1924		if (flags & (FIEMAP_EXTENT_DATA_TAIL | FIEMAP_EXTENT_DATA_INLINE))
  1925			flags |= FIEMAP_EXTENT_NOT_ALIGNED;
  1926	
  1927		memset(&extent, 0, sizeof(extent));
  1928		extent.fe_logical = logical;
  1929		extent.fe_physical = phys;
  1930		extent.fe_length = len;
  1931		extent.fe_flags = flags;
  1932	
  1933		dest += fieinfo->fi_extents_mapped;
  1934		memcpy(dest, &extent, sizeof(extent));
  1935	
  1936		fieinfo->fi_extents_mapped++;
  1937		if (fieinfo->fi_extents_mapped == fieinfo->fi_extents_max)
  1938			return 1;
  1939		return (flags & FIEMAP_EXTENT_LAST) ? 1 : 0;
  1940	}
  1941	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux