public inbox for [email protected]
 help / color / mirror / Atom feed
* [ammarfaizi2-block:dhowells/linux-fs/netfs-maple 33/40] fs/netfs/buffered_write.c:28:40: sparse: sparse: incompatible types in comparison expression (different type sizes):
@ 2022-04-05 13:00 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-04-05 13:00 UTC (permalink / raw)
  To: David Howells; +Cc: kbuild-all, GNU/Weeb Mailing List, linux-kernel

tree:   https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/netfs-maple
head:   674eea41fc70a740ff83ec590f9833f805852464
commit: 073b0ba90614945b31bccfede6e00102b7eb460e [33/40] netfs: Implement buffered writes through netfs_file_write_iter()
config: i386-randconfig-s002 (https://download.01.org/0day-ci/archive/20220405/[email protected]/config)
compiler: gcc-11 (Debian 11.2.0-19) 11.2.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/ammarfaizi2/linux-block/commit/073b0ba90614945b31bccfede6e00102b7eb460e
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/netfs-maple
        git checkout 073b0ba90614945b31bccfede6e00102b7eb460e
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash fs/netfs/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


sparse warnings: (new ones prefixed by >>)
>> fs/netfs/buffered_write.c:28:40: sparse: sparse: incompatible types in comparison expression (different type sizes):
>> fs/netfs/buffered_write.c:28:40: sparse:    unsigned long *
>> fs/netfs/buffered_write.c:28:40: sparse:    unsigned int *
>> fs/netfs/buffered_write.c:94:25: sparse: sparse: incompatible types in comparison expression (different signedness):
>> fs/netfs/buffered_write.c:94:25: sparse:    unsigned long long *
>> fs/netfs/buffered_write.c:94:25: sparse:    long long *
   fs/netfs/buffered_write.c:95:25: sparse: sparse: incompatible types in comparison expression (different signedness):
   fs/netfs/buffered_write.c:95:25: sparse:    unsigned long long *
   fs/netfs/buffered_write.c:95:25: sparse:    long long *

vim +28 fs/netfs/buffered_write.c

    18	
    19	static size_t copy_folio_from_iter_atomic(struct folio *folio,
    20						  unsigned int offset, size_t size,
    21						  struct iov_iter *i)
    22	{
    23		size_t copied = 0, n;
    24	
    25		do {
    26			unsigned int index   = offset / PAGE_SIZE;
    27			unsigned int poffset = offset % PAGE_SIZE;
  > 28			unsigned int psize   = min(PAGE_SIZE - offset, size);
    29	
    30			n = copy_page_from_iter_atomic(folio_file_page(folio, index),
    31						       poffset, psize, i);
    32			copied += n;
    33			if (n < psize)
    34				break;
    35			size -= n;
    36		} while (size);
    37		return copied;
    38	}
    39	
    40	/*
    41	 * Initialise a new dirty folio group.  We have to round it out to any crypto
    42	 * alignment.
    43	 */
    44	static void netfs_init_dirty_region(struct netfs_i_context *ctx,
    45					    struct netfs_dirty_region *region,
    46					    struct file *file,
    47					    loff_t start, size_t len)
    48	{
    49		region->from		= start;
    50		region->to		= start + len;
    51		region->debug_id	= atomic_inc_return(&netfs_region_debug_ids);
    52	
    53		if (file && ctx->ops->init_dirty_region)
    54			ctx->ops->init_dirty_region(region, file);
    55	
    56		trace_netfs_ref_region(region->debug_id, refcount_read(&region->ref),
    57				       netfs_region_trace_new);
    58	}
    59	
    60	/*
    61	 * Return true if two dirty regions are compatible such that b can be merged
    62	 * onto the end of a.
    63	 */
    64	bool netfs_are_regions_mergeable(struct netfs_i_context *ctx,
    65					 struct netfs_dirty_region *a,
    66					 struct netfs_dirty_region *b)
    67	{
    68		if (!netfs_mas_is_valid(a) || !netfs_mas_is_valid(b))
    69			return a == b;
    70		if (b->waiting_on_wb != a->waiting_on_wb)
    71			return false;
    72		if (b->from != a->to &&
    73		    b->from < ctx->zero_point)
    74			return false;
    75		if (ctx->ops->are_regions_mergeable)
    76			return ctx->ops->are_regions_mergeable(ctx, a, b);
    77		return true;
    78	}
    79	
    80	/*
    81	 * Subsume the modifications into an existing target region.  Returns true if
    82	 * we need to update the dirty_regions tree.
    83	 */
    84	static bool netfs_subsume_into_existing(struct netfs_i_context *ctx,
    85						struct folio *folio,
    86						struct ma_state *mas,
    87						struct netfs_dirty_region **_target,
    88						struct netfs_dirty_region **_to_put,
    89						pgoff_t *_first, pgoff_t *_last,
    90						size_t offset, size_t len)
    91	{
    92		struct netfs_dirty_region *target = *_target, *prev;
    93	
  > 94		target->from  = min(target->from, folio_pos(folio) + offset);
    95		target->to    = max(target->to,   folio_pos(folio) + offset + len);
    96		trace_netfs_dirty(ctx, target, NULL, *_first, *_last,
    97				  netfs_dirty_trace_modified);
    98	
    99		/* We might have bridged to the previous region also. */
   100		prev = mas_prev(mas, *_first - 1);
   101		if (!netfs_mas_is_valid(prev))
   102			return false;
   103	
   104		if (prev->to != target->from ||
   105		    prev->waiting_on_wb != target->waiting_on_wb)
   106			return false;
   107	
   108		*_first = mas->index;
   109		prev->to = target->to;
   110		*_to_put = target;
   111		trace_netfs_dirty(ctx, prev, NULL, *_first, *_last,
   112				  netfs_dirty_trace_merged_prev);
   113		return true;
   114	}
   115	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-05 13:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-05 13:00 [ammarfaizi2-block:dhowells/linux-fs/netfs-maple 33/40] fs/netfs/buffered_write.c:28:40: sparse: sparse: incompatible types in comparison expression (different type sizes): kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox