Re: [PATCH 2/2] md: don't account sync_io if iostats of the disk is disabled

From: kernel test robot
Date: Mon Dec 11 2023 - 16:43:21 EST


Hi,

kernel test robot noticed the following build errors:

[auto build test ERROR on song-md/md-next]
[also build test ERROR on axboe-block/for-next linus/master v6.7-rc5 next-20231211]
[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/linan666-huaweicloud-com/md-Fix-overflow-in-is_mddev_idle/20231211-155833
base: git://git.kernel.org/pub/scm/linux/kernel/git/song/md.git md-next
patch link: https://lore.kernel.org/r/20231211075614.1850003-3-linan666%40huaweicloud.com
patch subject: [PATCH 2/2] md: don't account sync_io if iostats of the disk is disabled
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20231212/202312120536.VqOKGsPZ-lkp@xxxxxxxxx/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231212/202312120536.VqOKGsPZ-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/202312120536.VqOKGsPZ-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

In file included from include/linux/kernel.h:23,
from include/linux/sched/mm.h:5,
from drivers/md/md.c:40:
drivers/md/md.h: In function 'md_sync_acct_bio':
>> drivers/md/md.h:587:35: error: stray '\342' in program
587 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:50:44: note: in definition of macro 'bitop'
50 | __builtin_constant_p((uintptr_t)(addr) != (uintptr_t)NULL) && \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.h:587:31: error: 'disk' undeclared (first use in this function)
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~
include/linux/bitops.h:50:44: note: in definition of macro 'bitop'
50 | __builtin_constant_p((uintptr_t)(addr) != (uintptr_t)NULL) && \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
drivers/md/md.h:587:31: note: each undeclared identifier is reported only once for each function it appears in
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~
include/linux/bitops.h:50:44: note: in definition of macro 'bitop'
50 | __builtin_constant_p((uintptr_t)(addr) != (uintptr_t)NULL) && \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.h:587:37: error: 'queue' undeclared (first use in this function); did you mean 'sigqueue'?
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~
include/linux/bitops.h:50:44: note: in definition of macro 'bitop'
50 | __builtin_constant_p((uintptr_t)(addr) != (uintptr_t)NULL) && \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.h:587:35: error: stray '\342' in program
587 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:51:23: note: in definition of macro 'bitop'
51 | (uintptr_t)(addr) != (uintptr_t)NULL && \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.h:587:35: error: stray '\342' in program
587 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:52:57: note: in definition of macro 'bitop'
52 | __builtin_constant_p(*(const unsigned long *)(addr))) ? \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.h:587:35: error: stray '\342' in program
587 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:53:24: note: in definition of macro 'bitop'
53 | const##op(nr, addr) : op(nr, addr))
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.h:587:35: error: stray '\342' in program
587 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:53:39: note: in definition of macro 'bitop'
53 | const##op(nr, addr) : op(nr, addr))
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
drivers/md/md.c: In function 'is_mddev_idle':
>> drivers/md/md.c:8517:43: error: stray '\342' in program
8517 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:50:44: note: in definition of macro 'bitop'
50 | __builtin_constant_p((uintptr_t)(addr) != (uintptr_t)NULL) && \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.c:8517:21: note: in expansion of macro 'blk_queue_io_stat'
8517 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.c:8517:45: error: 'queue' undeclared (first use in this function); did you mean 'sigqueue'?
8517 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~
include/linux/bitops.h:50:44: note: in definition of macro 'bitop'
50 | __builtin_constant_p((uintptr_t)(addr) != (uintptr_t)NULL) && \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.c:8517:21: note: in expansion of macro 'blk_queue_io_stat'
8517 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.c:8517:43: error: stray '\342' in program
8517 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:51:23: note: in definition of macro 'bitop'
51 | (uintptr_t)(addr) != (uintptr_t)NULL && \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.c:8517:21: note: in expansion of macro 'blk_queue_io_stat'
8517 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.c:8517:43: error: stray '\342' in program
8517 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:52:57: note: in definition of macro 'bitop'
52 | __builtin_constant_p(*(const unsigned long *)(addr))) ? \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.c:8517:21: note: in expansion of macro 'blk_queue_io_stat'
8517 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.c:8517:43: error: stray '\342' in program
8517 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:53:24: note: in definition of macro 'bitop'
53 | const##op(nr, addr) : op(nr, addr))
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.c:8517:21: note: in expansion of macro 'blk_queue_io_stat'
8517 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.c:8517:43: error: stray '\342' in program
8517 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:53:39: note: in definition of macro 'bitop'
53 | const##op(nr, addr) : op(nr, addr))
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.c:8517:21: note: in expansion of macro 'blk_queue_io_stat'
8517 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
--
In file included from include/linux/thread_info.h:27,
from arch/arm64/include/asm/preempt.h:6,
from include/linux/preempt.h:79,
from include/linux/spinlock.h:56,
from include/linux/wait.h:9,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from include/linux/highmem.h:5,
from include/linux/bvec.h:10,
from include/linux/blk_types.h:10,
from include/linux/blkdev.h:9,
from drivers/md/md-bitmap.c:19:
drivers/md/md.h: In function 'md_sync_acct_bio':
>> drivers/md/md.h:587:35: error: stray '\342' in program
587 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:50:44: note: in definition of macro 'bitop'
50 | __builtin_constant_p((uintptr_t)(addr) != (uintptr_t)NULL) && \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.h:587:31: error: 'disk' undeclared (first use in this function)
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~
include/linux/bitops.h:50:44: note: in definition of macro 'bitop'
50 | __builtin_constant_p((uintptr_t)(addr) != (uintptr_t)NULL) && \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
drivers/md/md.h:587:31: note: each undeclared identifier is reported only once for each function it appears in
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~
include/linux/bitops.h:50:44: note: in definition of macro 'bitop'
50 | __builtin_constant_p((uintptr_t)(addr) != (uintptr_t)NULL) && \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.h:587:37: error: 'queue' undeclared (first use in this function); did you mean 'sigqueue'?
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~
include/linux/bitops.h:50:44: note: in definition of macro 'bitop'
50 | __builtin_constant_p((uintptr_t)(addr) != (uintptr_t)NULL) && \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.h:587:35: error: stray '\342' in program
587 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:51:23: note: in definition of macro 'bitop'
51 | (uintptr_t)(addr) != (uintptr_t)NULL && \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.h:587:35: error: stray '\342' in program
587 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:52:57: note: in definition of macro 'bitop'
52 | __builtin_constant_p(*(const unsigned long *)(addr))) ? \
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.h:587:35: error: stray '\342' in program
587 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:53:24: note: in definition of macro 'bitop'
53 | const##op(nr, addr) : op(nr, addr))
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~
>> drivers/md/md.h:587:35: error: stray '\342' in program
587 | if (blk_queue_io_stat(disk<U+2014>>queue))
| ^~~~~~~~
include/linux/bitops.h:53:39: note: in definition of macro 'bitop'
53 | const##op(nr, addr) : op(nr, addr))
| ^~~~
include/linux/blkdev.h:567:33: note: in expansion of macro 'test_bit'
567 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
| ^~~~~~~~
drivers/md/md.h:587:13: note: in expansion of macro 'blk_queue_io_stat'
587 | if (blk_queue_io_stat(disk—>queue))
| ^~~~~~~~~~~~~~~~~


vim +/342 +587 drivers/md/md.h

584
585 static inline void md_sync_acct_bio(struct bio *bio, unsigned long nr_sectors)
586 {
> 587 if (blk_queue_io_stat(disk—>queue))
588 md_sync_acct(bio->bi_bdev, nr_sectors);
589 }
590

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