arch/m68k/coldfire/m523x.c:31:19: sparse: sparse: symbol 'm523x_clk_lookup' was not declared. Should it be static?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f1baf68e1383f6ed93eb9cff2866d46562607a43
commit: 63aadb77669a6856b26d73da85b4f788731524a3 m68k: coldfire: use clkdev_lookup on most coldfire
date: 8 months ago
config: m68k-randconfig-s032-20220211 (https://download.01.org/0day-ci/archive/20220211/202202111434.ezwGbZ9a-lk...)
compiler: m68k-linux-gcc (GCC) 11.2.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-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 63aadb77669a6856b26d73da85b4f788731524a3
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=m68k SHELL=/bin/bash arch/m68k/coldfire/ drivers/net/ethernet/cirrus/
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 >>)
>> arch/m68k/coldfire/m523x.c:31:19: sparse: sparse: symbol 'm523x_clk_lookup' was not declared. Should it be static?
vim +/m523x_clk_lookup +31 arch/m68k/coldfire/m523x.c
30
> 31 struct clk_lookup m523x_clk_lookup[] = {
32 CLKDEV_INIT(NULL, "pll.0", &clk_pll),
33 CLKDEV_INIT(NULL, "sys.0", &clk_sys),
34 CLKDEV_INIT("mcfpit.0", NULL, &clk_pll),
35 CLKDEV_INIT("mcfpit.1", NULL, &clk_pll),
36 CLKDEV_INIT("mcfpit.2", NULL, &clk_pll),
37 CLKDEV_INIT("mcfpit.3", NULL, &clk_pll),
38 CLKDEV_INIT("mcfuart.0", NULL, &clk_sys),
39 CLKDEV_INIT("mcfuart.1", NULL, &clk_sys),
40 CLKDEV_INIT("mcfuart.2", NULL, &clk_sys),
41 CLKDEV_INIT("mcfqspi.0", NULL, &clk_sys),
42 CLKDEV_INIT("fec.0", NULL, &clk_sys),
43 CLKDEV_INIT("imx1-i2c.0", NULL, &clk_sys),
44 };
45
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[ammarfaizi2-block:dhowells/linux-fs/netfs-maple 25/35] fs/fs-writeback.c:2789:2: error: implicit declaration of function 'wbc_attach_unlock_fdatawrite_inode'
by kernel test robot
tree: https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/netfs-maple
head: 429e2bb6fb190f390ed23afc0d2308e877c43be5
commit: 9c1befbc079fcef04228d2b67e931f9635d58591 [25/35] vfs: Take I_SYNC whilst performing fsync() and similar
config: arm-colibri_pxa270_defconfig (https://download.01.org/0day-ci/archive/20220211/202202111418.cjJuXYM8-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project f6685f774697c85d6a352dcea013f46a99f9fe31)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/ammarfaizi2/linux-block/commit/9c1befbc079fcef04228d2b...
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/netfs-maple
git checkout 9c1befbc079fcef04228d2b67e931f9635d58591
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> fs/fs-writeback.c:2789:2: error: implicit declaration of function 'wbc_attach_unlock_fdatawrite_inode' [-Werror,-Wimplicit-function-declaration]
wbc_attach_unlock_fdatawrite_inode(wbc, inode);
^
fs/fs-writeback.c:2789:2: note: did you mean 'wbc_attach_fdatawrite_inode'?
include/linux/writeback.h:325:20: note: 'wbc_attach_fdatawrite_inode' declared here
static inline void wbc_attach_fdatawrite_inode(struct writeback_control *wbc,
^
1 error generated.
vim +/wbc_attach_unlock_fdatawrite_inode +2789 fs/fs-writeback.c
2762
2763 /**
2764 * filemap_fdatawrite_wbc - start writeback on mapping dirty pages in range
2765 * @mapping: address space structure to write
2766 * @wbc: the writeback_control controlling the writeout
2767 *
2768 * Call writepages on the mapping using the provided wbc to control the
2769 * writeout.
2770 *
2771 * Return: %0 on success, negative error code otherwise.
2772 */
2773 int filemap_fdatawrite_wbc(struct address_space *mapping,
2774 struct writeback_control *wbc)
2775 {
2776 struct inode *inode = mapping->host;
2777 int ret;
2778
2779 if (!mapping_can_writeback(mapping) ||
2780 !mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))
2781 return 0;
2782
2783 spin_lock(&inode->i_lock);
2784 if (inode->i_state & I_SYNC) {
2785 __inode_wait_for_writeback(inode);
2786 WARN_ON(inode->i_state & I_SYNC);
2787 }
2788
> 2789 wbc_attach_unlock_fdatawrite_inode(wbc, inode);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[ammarfaizi2-block:dhowells/linux-fs/netfs-maple 29/35] fs/netfs/write_helper.c:28:40: sparse: sparse: incompatible types in comparison expression (different type sizes):
by kernel test robot
tree: https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/netfs-maple
head: 429e2bb6fb190f390ed23afc0d2308e877c43be5
commit: 01abe2ebb0b5676c9d0394947cfeea45d0f5c09f [29/35] netfs: Implement buffered writes through netfs_file_write_iter()
config: xtensa-randconfig-s031-20220211 (https://download.01.org/0day-ci/archive/20220211/202202111406.PpKHKjMT-lk...)
compiler: xtensa-linux-gcc (GCC) 11.2.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-dirty
# https://github.com/ammarfaizi2/linux-block/commit/01abe2ebb0b5676c9d03949...
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/netfs-maple
git checkout 01abe2ebb0b5676c9d0394947cfeea45d0f5c09f
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=xtensa SHELL=/bin/bash fs/netfs/
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/netfs/write_helper.c: note: in included file (through arch/xtensa/include/asm/bitops.h, include/linux/bitops.h, include/linux/log2.h, ...):
arch/xtensa/include/asm/processor.h:107:2: sparse: sparse: Unsupported xtensa ABI
arch/xtensa/include/asm/processor.h:137:2: sparse: sparse: Unsupported Xtensa ABI
>> fs/netfs/write_helper.c:28:40: sparse: sparse: incompatible types in comparison expression (different type sizes):
>> fs/netfs/write_helper.c:28:40: sparse: unsigned long *
>> fs/netfs/write_helper.c:28:40: sparse: unsigned int *
>> fs/netfs/write_helper.c:126:25: sparse: sparse: incompatible types in comparison expression (different signedness):
>> fs/netfs/write_helper.c:126:25: sparse: unsigned long long *
>> fs/netfs/write_helper.c:126:25: sparse: long long *
fs/netfs/write_helper.c:127:25: sparse: sparse: incompatible types in comparison expression (different signedness):
fs/netfs/write_helper.c:127:25: sparse: unsigned long long *
fs/netfs/write_helper.c:127:25: sparse: long long *
vim +28 fs/netfs/write_helper.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 enum netfs_write_type write_type,
48 loff_t start, size_t len)
49 {
50 struct netfs_flush_group *group;
51
52 region->from = start;
53 region->to = start + len;
54 region->debug_id = atomic_inc_return(&netfs_region_debug_ids);
55 refcount_set(®ion->ref, 1);
56
57 switch (write_type) {
58 case NETFS_ORDINARY_WRITE:
59 case NETFS_DIO_WRITE:
60 break;
61 case NETFS_SYNC_WRITE:
62 __set_bit(NETFS_REGION_SYNC, ®ion->flags);
63 break;
64 case NETFS_DSYNC_WRITE:
65 __set_bit(NETFS_REGION_DSYNC, ®ion->flags);
66 break;
67 }
68
69 if (file && ctx->ops->init_dirty_region)
70 ctx->ops->init_dirty_region(region, file);
71
72 if (!region->group) {
73 group = list_last_entry(&ctx->flush_groups,
74 struct netfs_flush_group, group_link);
75 region->group = netfs_get_flush_group(group);
76 }
77 trace_netfs_ref_region(region->debug_id, refcount_read(®ion->ref),
78 netfs_region_trace_new);
79 }
80
81 /*
82 * Decide if/how a write can be merged with a dirty region.
83 */
84 static bool netfs_is_write_compatible(struct netfs_i_context *ctx,
85 struct netfs_dirty_region *old,
86 struct netfs_dirty_region *candidate)
87 {
88 /* Regions being actively flushed can't be merged with */
89 if (netfs_mas_is_flushing(old) ||
90 candidate->group != old->group ||
91 test_bit(NETFS_FGROUP_FLUSHED, &old->group->flags)) {
92 _leave(" = f [flush]");
93 return false;
94 }
95
96 if (test_bit(NETFS_REGION_DSYNC, &old->flags)) {
97 _leave(" = f [dsync]");
98 return false;
99 }
100
101 if (!ctx->ops->is_write_compatible) {
102 if (test_bit(NETFS_REGION_DSYNC, &candidate->flags)) {
103 _leave(" = f [dsync]");
104 return false;
105 }
106 _leave(" = t");
107 return true;
108 }
109 return ctx->ops->is_write_compatible(ctx, old, candidate);
110 }
111
112 /*
113 * Subsume the modifications into an existing target region. Returns true if
114 * we need to update the dirty_regions tree.
115 */
116 static bool netfs_subsume_into_existing(struct netfs_i_context *ctx,
117 struct folio *folio,
118 struct ma_state *mas,
119 struct netfs_dirty_region **_target,
120 struct netfs_dirty_region **_to_put,
121 pgoff_t *_first, pgoff_t *_last,
122 size_t offset, size_t len)
123 {
124 struct netfs_dirty_region *target = *_target, *prev;
125
> 126 target->from = min(target->from, folio_pos(folio) + offset);
127 target->to = max(target->to, folio_pos(folio) + offset + len);
128 trace_netfs_dirty(ctx, target, NULL, *_first, *_last,
129 netfs_dirty_trace_modified);
130
131 /* We might have bridged to the previous region also. */
132 prev = mas_prev(mas, *_first - 1);
133 if (!netfs_mas_is_valid(prev))
134 return false;
135
136 if (prev->to != target->from ||
137 prev->waiting_on_wb != target->waiting_on_wb)
138 return false;
139
140 *_first = mas->index;
141 prev->to = target->to;
142 *_to_put = target;
143 trace_netfs_dirty(ctx, prev, NULL, *_first, *_last,
144 netfs_dirty_trace_merged_prev);
145 return true;
146 }
147
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
drivers/media/platform/marvell-ccic/mmp-driver.c:366:34: warning: unused variable 'mmpcam_of_match'
by kernel test robot
Hi Arnd,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f1baf68e1383f6ed93eb9cff2866d46562607a43
commit: b408b611eb951594691abfee8ca687b405d27757 mips: ar7: convert to CONFIG_COMMON_CLK
date: 8 months ago
config: mips-buildonly-randconfig-r001-20220211 (https://download.01.org/0day-ci/archive/20220211/202202111412.5iSkckar-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project f6685f774697c85d6a352dcea013f46a99f9fe31)
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 mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout b408b611eb951594691abfee8ca687b405d27757
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/media/platform/atmel/ drivers/media/platform/marvell-ccic/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/media/platform/marvell-ccic/mmp-driver.c:366:34: warning: unused variable 'mmpcam_of_match' [-Wunused-const-variable]
static const struct of_device_id mmpcam_of_match[] = {
^
1 warning generated.
vim +/mmpcam_of_match +366 drivers/media/platform/marvell-ccic/mmp-driver.c
bb0a896e3d5083 drivers/media/video/marvell-ccic/mmp-driver.c Jonathan Corbet 2011-12-30 365
83c40e6611ec1e drivers/media/platform/marvell-ccic/mmp-driver.c Lubomir Rintel 2019-05-28 @366 static const struct of_device_id mmpcam_of_match[] = {
83c40e6611ec1e drivers/media/platform/marvell-ccic/mmp-driver.c Lubomir Rintel 2019-05-28 367 { .compatible = "marvell,mmp2-ccic", },
83c40e6611ec1e drivers/media/platform/marvell-ccic/mmp-driver.c Lubomir Rintel 2019-05-28 368 {},
83c40e6611ec1e drivers/media/platform/marvell-ccic/mmp-driver.c Lubomir Rintel 2019-05-28 369 };
08aac0e32fe44b drivers/media/platform/marvell-ccic/mmp-driver.c Lubomir Rintel 2019-07-22 370 MODULE_DEVICE_TABLE(of, mmpcam_of_match);
67a8dbbc4e04cd drivers/media/video/marvell-ccic/mmp-driver.c Jonathan Corbet 2011-06-11 371
:::::: The code at line 366 was first introduced by commit
:::::: 83c40e6611ec1e548ece34f6940f516333abc16a media: marvell-ccic/mmp: add devicetree support
:::::: TO: Lubomir Rintel <lkundrak(a)v3.sk>
:::::: CC: Mauro Carvalho Chehab <mchehab+samsung(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[ammarfaizi2-block:dhowells/linux-fs/netfs-maple 35/35] fs/netfs/flush.c:471:9: error: implicit declaration of function 'netfs_proc_add_writeback'; did you mean 'netfs_proc_add_wback'?
by kernel test robot
tree: https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/netfs-maple
head: 429e2bb6fb190f390ed23afc0d2308e877c43be5
commit: 429e2bb6fb190f390ed23afc0d2308e877c43be5 [35/35] netfs: Provide /proc/fs/netfs/writebacks to display writeback slices
config: s390-randconfig-r033-20220211 (https://download.01.org/0day-ci/archive/20220211/202202111413.GIY04Zw3-lk...)
compiler: s390-linux-gcc (GCC) 11.2.0
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
# https://github.com/ammarfaizi2/linux-block/commit/429e2bb6fb190f390ed23af...
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/netfs-maple
git checkout 429e2bb6fb190f390ed23afc0d2308e877c43be5
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=s390 SHELL=/bin/bash fs/netfs/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
fs/netfs/flush.c: In function 'netfs_flush_dirty':
>> fs/netfs/flush.c:471:9: error: implicit declaration of function 'netfs_proc_add_writeback'; did you mean 'netfs_proc_add_wback'? [-Werror=implicit-function-declaration]
471 | netfs_proc_add_writeback(wback);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| netfs_proc_add_wback
cc1: some warnings being treated as errors
--
fs/netfs/objects.c: In function 'netfs_put_writeback':
>> fs/netfs/objects.c:205:25: error: implicit declaration of function 'netfs_proc_del_writeback'; did you mean 'netfs_proc_del_wback'? [-Werror=implicit-function-declaration]
205 | netfs_proc_del_writeback(wback);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| netfs_proc_del_wback
cc1: some warnings being treated as errors
vim +471 fs/netfs/flush.c
293
294 /*
295 * Flush some of the dirty queue, transforming a part of a sequence of dirty
296 * regions into a block we can flush.
297 *
298 * A number of things constrain us:
299 * - The region we write out should not be undergoing modification
300 * - We may need to expand or split the region for a number of reasons:
301 * - Filesystem storage block/object size
302 * - Filesystem RPC size (wsize)
303 * - Cache block size
304 * - Cache DIO block size
305 * - Crypto/compression block size
306 *
307 * This may be entered multiple times simultaneously. Automatic flushing by
308 * the VM is serialised on I_SYNC, but things like fsync() may enter multiple
309 * times simultaneously.
310 */
311 static int netfs_flush_dirty(struct netfs_writeback *wback,
312 struct writeback_control *wbc,
313 struct netfs_i_context *ctx,
314 struct ma_state *mas,
315 pgoff_t *_first, pgoff_t last,
316 struct netfs_dirty_region *spares[2])
317 {
318 struct netfs_dirty_region *region;
319 struct folio *folio;
320 pgoff_t first = *_first;
321 pgoff_t csize = 1UL << ctx->cache_order;
322 long ret;
323
324 XA_STATE(xas, &wback->mapping->i_pages, 0);
325
326 /* Round out the range we're looking through to accommodate whole cache
327 * blocks. The cache may only be able to store blocks of that size, in
328 * which case we may need to add non-dirty pages to the buffer too.
329 */
330 if (ctx->cache_order) {
331 first = round_down(first, csize);
332 last = round_up_incl(last, csize);
333 }
334
335 _enter("%lx-%lx", first, last);
336
337 rcu_read_lock();
338 mtree_lock(&ctx->dirty_regions);
339
340 /* Find the first dirty region that overlaps the requested range */
341 mas_set(mas, first);
342 do {
343 region = mas_find(mas, last);
344 if (!region)
345 goto found_nothing;
346 } while (netfs_mas_is_flushing(region));
347
348 _debug("query D=%x %lx-%lx",
349 netfs_mas_is_valid(region) ? region->debug_id : 0,
350 mas->index, mas->last);
351
352 wback->first = max(mas->index, first);
353 if (wback->first > 0) {
354 _debug("nonz %lx", wback->first);
355
356 /* The first folio might extend backwards beyond the start of
357 * the proposed region - in which case we need to include that
358 * also. But at least, in such a case, the folio size has to
359 * be an integer multiple of the cache blocksize.
360 */
361 if (mas->index < wback->first) {
362 _debug("check folio %lx", wback->first);
363 xas_set(&xas, wback->first);
364 do {
365 xas_reset(&xas);
366 folio = xas_load(&xas);
367 } while (xas_retry(&xas, folio));
368
369 if (folio && !xa_is_value(folio)) {
370 _debug("check folio %lx", folio->index);
371 /* A region span *should not* end in the middle of a folio. */
372 BUG_ON(folio->index < mas->index);
373 if (folio->index < wback->first) {
374 wback->first = folio->index;
375 mas_set_range(mas, wback->first, mas->last);
376 }
377 }
378 }
379
380 _debug("fol %lx", wback->first);
381
382 if (mas->index < wback->first) {
383 pgoff_t saved_last = mas->last;
384 _debug("splitf %lx-%lx %lx", mas->index, mas->last, first);
385 netfs_split_off_front(ctx, mas, region, &spares[0], first - 1,
386 netfs_dirty_trace_split_off_front);
387 mas_set_range(mas, first, saved_last);
388 }
389
390 wback->last = mas->last;
391 }
392
393 while (mas->last < last) {
394 _debug("store %lx-%lx", mas->index, mas->last);
395 wback->last = mas->last;
396 mas_store(mas, netfs_mas_set_flushing(region));
397 if (region != NETFS_COPY_TO_CACHE) {
398 netfs_get_dirty_region(ctx, region, netfs_region_trace_get_wback);
399 list_add_tail(®ion->flush_link, &wback->regions);
400 trace_netfs_dirty(ctx, region, 0, mas->index, mas->last,
401 netfs_dirty_trace_flush);
402 }
403
404 region = mas_next(mas, mas->last + 1);
405 if (!region || netfs_mas_is_flushing(region))
406 goto no_more;
407 if (mas->last >= last)
408 break;
409 _debug("query+ D=%x %lx-%lx",
410 netfs_mas_is_valid(region) ? region->debug_id : 0,
411 mas->index, mas->last);
412 }
413
414 /* Deal with the region we're looking at exceeding the specified range.
415 * In such a case, we need to split the region - and the last folio may
416 * extend beyond the end of the proposed region - in which case we need
417 * to include that also. And, again, the folio size has to be an
418 * integer multiple of the cache blocksize.
419 */
420 if (mas->last > last) {
421 xas_set(&xas, last);
422 do {
423 xas_reset(&xas);
424 folio = xas_load(&xas);
425 } while (xas_retry(&xas, folio));
426
427 if (folio && !xa_is_value(folio)) {
428 pgoff_t flast = folio_next_index(folio) - 1;
429
430 _debug("flast %lx %lx %lx", flast, mas->last, last);
431 /* A region span *should not* end in the middle of a folio. */
432 BUG_ON(flast > mas->last);
433 if (flast > last) {
434 last = flast;
435 mas_set_range(mas, mas->index, last);
436 }
437 }
438
439 region = netfs_split_off_front(ctx, mas, region, &spares[1], last,
440 netfs_dirty_trace_split_off_back);
441 }
442
443 wback->last = mas->last;
444 mas_store(mas, netfs_mas_set_flushing(region));
445 if (region != NETFS_COPY_TO_CACHE) {
446 netfs_get_dirty_region(ctx, region, netfs_region_trace_get_wback);
447 list_add_tail(®ion->flush_link, &wback->regions);
448 trace_netfs_dirty(ctx, region, 0, mas->index, mas->last,
449 netfs_dirty_trace_flush2);
450 }
451
452 no_more:
453 /* We've now got a contiguous span. Some of the subspans may only need
454 * writing to the cache, whilst others need writing to both the server
455 * and the cache.
456 */
457 _debug("span %lx-%lx", wback->first, wback->last);
458 *_first = last + 1;
459 mtree_unlock(&ctx->dirty_regions);
460 rcu_read_unlock();
461
462 /* Load the pages into the raw-data buffer and transition them over to
463 * the writeback state.
464 */
465 ret = netfs_flush_get_pages(wback, ctx);
466 if (ret < 0)
467 goto undo;
468
469 netfs_writeback_lock(wback);
470 netfs_writeback_start(wback);
> 471 netfs_proc_add_writeback(wback);
472 trace_netfs_wback(wback);
473
474 wbc->nr_to_write -= wback->last - wback->first + 1;
475 *_first = wback->last + 1;
476 _leave(" = %lx [%lx]", wback->last - wback->first + 1, *_first);
477 return 1;
478
479 found_nothing:
480 *_first = last + 1;
481 mtree_unlock(&ctx->dirty_regions);
482 rcu_read_unlock();
483 return 0;
484
485 undo:
486 BUG(); // TODO
487 }
488
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[jlayton:ceph-fscrypt 55/57] net/ceph/messenger.c:1126:16: warning: comparison of distinct pointer types ('typeof (bytes) *' (aka 'unsigned int *') and 'typeof (((1UL) << (12))) *' (aka 'unsigned long *'))
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git ceph-fscrypt
head: adf69efebc954db1aa7af7b93febbc2a1b51dc6c
commit: 8647843c1c4c4ebffb864d049176b4d847ef3a4b [55/57] libceph: allow ceph_msg_data_advance to advance more than a page
config: riscv-randconfig-r016-20220211 (https://download.01.org/0day-ci/archive/20220211/202202111436.oS410AKW-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project f6685f774697c85d6a352dcea013f46a99f9fe31)
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-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/commit/...
git remote add jlayton https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git
git fetch --no-tags jlayton ceph-fscrypt
git checkout 8647843c1c4c4ebffb864d049176b4d847ef3a4b
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/cpuidle/ net/ceph/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
net/ceph/messenger.c:178:5: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
ntohs(in4->sin_port));
^~~~~~~~~~~~~~~~~~~~
include/linux/byteorder/generic.h:142:18: note: expanded from macro 'ntohs'
#define ntohs(x) ___ntohs(x)
^~~~~~~~~~~
include/linux/byteorder/generic.h:137:21: note: expanded from macro '___ntohs'
#define ___ntohs(x) __be16_to_cpu(x)
^~~~~~~~~~~~~~~~
include/uapi/linux/byteorder/little_endian.h:43:26: note: expanded from macro '__be16_to_cpu'
#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/ceph/messenger.c:184:5: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
ntohs(in6->sin6_port));
^~~~~~~~~~~~~~~~~~~~~
include/linux/byteorder/generic.h:142:18: note: expanded from macro 'ntohs'
#define ntohs(x) ___ntohs(x)
^~~~~~~~~~~
include/linux/byteorder/generic.h:137:21: note: expanded from macro '___ntohs'
#define ___ntohs(x) __be16_to_cpu(x)
^~~~~~~~~~~~~~~~
include/uapi/linux/byteorder/little_endian.h:43:26: note: expanded from macro '__be16_to_cpu'
#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> net/ceph/messenger.c:1126:16: warning: comparison of distinct pointer types ('typeof (bytes) *' (aka 'unsigned int *') and 'typeof (((1UL) << (12))) *' (aka 'unsigned long *')) [-Wcompare-distinct-pointer-types]
size_t cur = min(bytes, PAGE_SIZE);
^~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:45:19: note: expanded from macro 'min'
#define min(x, y) __careful_cmp(x, y, <)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
3 warnings generated.
vim +1126 net/ceph/messenger.c
1122
1123 void ceph_msg_data_advance(struct ceph_msg_data_cursor *cursor, size_t bytes)
1124 {
1125 while (bytes) {
> 1126 size_t cur = min(bytes, PAGE_SIZE);
1127
1128 __ceph_msg_data_advance(cursor, cur);
1129 bytes -= cur;
1130 }
1131 }
1132
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[ammarfaizi2-block:dhowells/linux-fs/netfs-maple 29/35] fs/netfs/write_helper.c:28:26: warning: comparison of distinct pointer types ('typeof (((1UL) << 12) - offset) *' (aka 'unsigned long *') and 'typeof (size) *' (aka 'unsigned int *'))
by kernel test robot
tree: https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/netfs-maple
head: 429e2bb6fb190f390ed23afc0d2308e877c43be5
commit: 01abe2ebb0b5676c9d0394947cfeea45d0f5c09f [29/35] netfs: Implement buffered writes through netfs_file_write_iter()
config: i386-randconfig-a015 (https://download.01.org/0day-ci/archive/20220211/202202111324.LBsc3lm4-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project f6685f774697c85d6a352dcea013f46a99f9fe31)
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
# https://github.com/ammarfaizi2/linux-block/commit/01abe2ebb0b5676c9d03949...
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/netfs-maple
git checkout 01abe2ebb0b5676c9d0394947cfeea45d0f5c09f
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 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 <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> fs/netfs/write_helper.c:28:26: warning: comparison of distinct pointer types ('typeof (((1UL) << 12) - offset) *' (aka 'unsigned long *') and 'typeof (size) *' (aka 'unsigned int *')) [-Wcompare-distinct-pointer-types]
unsigned int psize = min(PAGE_SIZE - offset, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:45:19: note: expanded from macro 'min'
#define min(x, y) __careful_cmp(x, y, <)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
>> fs/netfs/write_helper.c:126:18: warning: comparison of distinct pointer types ('typeof (target->from) *' (aka 'unsigned long long *') and 'typeof (folio_pos(folio) + offset) *' (aka 'long long *')) [-Wcompare-distinct-pointer-types]
target->from = min(target->from, folio_pos(folio) + offset);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:45:19: note: expanded from macro 'min'
#define min(x, y) __careful_cmp(x, y, <)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
>> fs/netfs/write_helper.c:127:18: warning: comparison of distinct pointer types ('typeof (target->to) *' (aka 'unsigned long long *') and 'typeof (folio_pos(folio) + offset + len) *' (aka 'long long *')) [-Wcompare-distinct-pointer-types]
target->to = max(target->to, folio_pos(folio) + offset + len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:52:19: note: expanded from macro 'max'
#define max(x, y) __careful_cmp(x, y, >)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
3 warnings generated.
vim +28 fs/netfs/write_helper.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 enum netfs_write_type write_type,
48 loff_t start, size_t len)
49 {
50 struct netfs_flush_group *group;
51
52 region->from = start;
53 region->to = start + len;
54 region->debug_id = atomic_inc_return(&netfs_region_debug_ids);
55 refcount_set(®ion->ref, 1);
56
57 switch (write_type) {
58 case NETFS_ORDINARY_WRITE:
59 case NETFS_DIO_WRITE:
60 break;
61 case NETFS_SYNC_WRITE:
62 __set_bit(NETFS_REGION_SYNC, ®ion->flags);
63 break;
64 case NETFS_DSYNC_WRITE:
65 __set_bit(NETFS_REGION_DSYNC, ®ion->flags);
66 break;
67 }
68
69 if (file && ctx->ops->init_dirty_region)
70 ctx->ops->init_dirty_region(region, file);
71
72 if (!region->group) {
73 group = list_last_entry(&ctx->flush_groups,
74 struct netfs_flush_group, group_link);
75 region->group = netfs_get_flush_group(group);
76 }
77 trace_netfs_ref_region(region->debug_id, refcount_read(®ion->ref),
78 netfs_region_trace_new);
79 }
80
81 /*
82 * Decide if/how a write can be merged with a dirty region.
83 */
84 static bool netfs_is_write_compatible(struct netfs_i_context *ctx,
85 struct netfs_dirty_region *old,
86 struct netfs_dirty_region *candidate)
87 {
88 /* Regions being actively flushed can't be merged with */
89 if (netfs_mas_is_flushing(old) ||
90 candidate->group != old->group ||
91 test_bit(NETFS_FGROUP_FLUSHED, &old->group->flags)) {
92 _leave(" = f [flush]");
93 return false;
94 }
95
96 if (test_bit(NETFS_REGION_DSYNC, &old->flags)) {
97 _leave(" = f [dsync]");
98 return false;
99 }
100
101 if (!ctx->ops->is_write_compatible) {
102 if (test_bit(NETFS_REGION_DSYNC, &candidate->flags)) {
103 _leave(" = f [dsync]");
104 return false;
105 }
106 _leave(" = t");
107 return true;
108 }
109 return ctx->ops->is_write_compatible(ctx, old, candidate);
110 }
111
112 /*
113 * Subsume the modifications into an existing target region. Returns true if
114 * we need to update the dirty_regions tree.
115 */
116 static bool netfs_subsume_into_existing(struct netfs_i_context *ctx,
117 struct folio *folio,
118 struct ma_state *mas,
119 struct netfs_dirty_region **_target,
120 struct netfs_dirty_region **_to_put,
121 pgoff_t *_first, pgoff_t *_last,
122 size_t offset, size_t len)
123 {
124 struct netfs_dirty_region *target = *_target, *prev;
125
> 126 target->from = min(target->from, folio_pos(folio) + offset);
> 127 target->to = max(target->to, folio_pos(folio) + offset + len);
128 trace_netfs_dirty(ctx, target, NULL, *_first, *_last,
129 netfs_dirty_trace_modified);
130
131 /* We might have bridged to the previous region also. */
132 prev = mas_prev(mas, *_first - 1);
133 if (!netfs_mas_is_valid(prev))
134 return false;
135
136 if (prev->to != target->from ||
137 prev->waiting_on_wb != target->waiting_on_wb)
138 return false;
139
140 *_first = mas->index;
141 prev->to = target->to;
142 *_to_put = target;
143 trace_netfs_dirty(ctx, prev, NULL, *_first, *_last,
144 netfs_dirty_trace_merged_prev);
145 return true;
146 }
147
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
arch/x86/include/asm/paravirt.h:221:9: sparse: sparse: cast truncates bits from constant value (c000000000100000 becomes 100000)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f1baf68e1383f6ed93eb9cff2866d46562607a43
commit: faff44069ff538ccdfef187c4d7ec83d22dfb3a4 x86/hyperv: Add Write/Read MSR registers via ghcb page
date: 4 months ago
config: x86_64-randconfig-s022 (https://download.01.org/0day-ci/archive/20220211/202202111322.CtsKURBj-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout faff44069ff538ccdfef187c4d7ec83d22dfb3a4
# 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=x86_64 SHELL=/bin/bash drivers/hv/
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 >>)
drivers/hv/vmbus_drv.c: note: in included file (through arch/x86/include/asm/msr.h, arch/x86/include/asm/processor.h, arch/x86/include/asm/timex.h, ...):
>> arch/x86/include/asm/paravirt.h:221:9: sparse: sparse: cast truncates bits from constant value (c000000000100000 becomes 100000)
arch/x86/include/asm/paravirt.h:221:9: sparse: sparse: cast truncates bits from constant value (c000000000000000 becomes 0)
vim +221 arch/x86/include/asm/paravirt.h
d3561b7fa0fb0fc include/asm-i386/paravirt.h Rusty Russell 2006-12-07 218
47edb65178cb705 arch/x86/include/asm/paravirt.h Andy Lutomirski 2015-07-23 219 static inline void wrmsrl(unsigned msr, u64 val)
47edb65178cb705 arch/x86/include/asm/paravirt.h Andy Lutomirski 2015-07-23 220 {
47edb65178cb705 arch/x86/include/asm/paravirt.h Andy Lutomirski 2015-07-23 @221 wrmsr(msr, (u32)val, (u32)(val>>32));
47edb65178cb705 arch/x86/include/asm/paravirt.h Andy Lutomirski 2015-07-23 222 }
47edb65178cb705 arch/x86/include/asm/paravirt.h Andy Lutomirski 2015-07-23 223
:::::: The code at line 221 was first introduced by commit
:::::: 47edb65178cb7056c2eea0b6c41a7d8c84547192 x86/asm/msr: Make wrmsrl() a function
:::::: TO: Andy Lutomirski <luto(a)kernel.org>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week