2023-12-11 07:57:53

by Li Nan

[permalink] [raw]
Subject: [PATCH 0/2] md: fix is_mddev_idle()

From: Li Nan <[email protected]>

Li Nan (2):
md: Fix overflow in is_mddev_idle
md: don't account sync_io if iostats of the disk is disabled

drivers/md/md.h | 7 ++++---
include/linux/blkdev.h | 2 +-
drivers/md/md.c | 11 ++++++++---
3 files changed, 13 insertions(+), 7 deletions(-)

--
2.39.2


2023-12-11 07:57:54

by Li Nan

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

From: Li Nan <[email protected]>

If iostats is disabled, disk_stats will not be updated and
part_stat_read_accum() only returns a constant value. In this case,
continuing to count sync_io and to check is_mddev_idle() is no longer
meaningful.

Signed-off-by: Li Nan <[email protected]>
---
drivers/md/md.h | 3 ++-
drivers/md/md.c | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/md/md.h b/drivers/md/md.h
index 1a4f976951c1..d57e765b4ec2 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -589,7 +589,8 @@ static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sect

static inline void md_sync_acct_bio(struct bio *bio, unsigned long nr_sectors)
{
- md_sync_acct(bio->bi_bdev, nr_sectors);
+ if (blk_queue_io_stat(disk—>queue))
+ md_sync_acct(bio->bi_bdev, nr_sectors);
}

struct md_personality
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 1d71b2a9af03..9a3610bcc75f 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -8502,6 +8502,10 @@ static int is_mddev_idle(struct mddev *mddev, int init)
rcu_read_lock();
rdev_for_each_rcu(rdev, mddev) {
struct gendisk *disk = rdev->bdev->bd_disk;
+
+ if (blk_queue_io_stat(disk—>queue))
+ continue;
+
curr_events =
(long long)part_stat_read_accum(disk->part0, sectors) -
atomic64_read(&disk->sync_io);
--
2.39.2

2023-12-11 07:58:03

by Li Nan

[permalink] [raw]
Subject: [PATCH 1/2] md: Fix overflow in is_mddev_idle

From: Li Nan <[email protected]>

UBSAN reports this problem:

UBSAN: Undefined behaviour in drivers/md/md.c:8175:15
signed integer overflow:
-2147483291 - 2072033152 cannot be represented in type 'int'
Call trace:
dump_backtrace+0x0/0x310
show_stack+0x28/0x38
dump_stack+0xec/0x15c
ubsan_epilogue+0x18/0x84
handle_overflow+0x14c/0x19c
__ubsan_handle_sub_overflow+0x34/0x44
is_mddev_idle+0x338/0x3d8
md_do_sync+0x1bb8/0x1cf8
md_thread+0x220/0x288
kthread+0x1d8/0x1e0
ret_from_fork+0x10/0x18

'curr_events' will overflow when stat accum or 'sync_io' is greater than
INT_MAX.

Fix it by changing sync_io, last_events and curr_events to 64bit.

Signed-off-by: Li Nan <[email protected]>
---
drivers/md/md.h | 4 ++--
include/linux/blkdev.h | 2 +-
drivers/md/md.c | 7 ++++---
3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/md/md.h b/drivers/md/md.h
index ade83af123a2..1a4f976951c1 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -50,7 +50,7 @@ struct md_rdev {

sector_t sectors; /* Device size (in 512bytes sectors) */
struct mddev *mddev; /* RAID array if running */
- int last_events; /* IO event timestamp */
+ long long last_events; /* IO event timestamp */

/*
* If meta_bdev is non-NULL, it means that a separate device is
@@ -584,7 +584,7 @@ extern void mddev_unlock(struct mddev *mddev);

static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors)
{
- atomic_add(nr_sectors, &bdev->bd_disk->sync_io);
+ atomic64_add(nr_sectors, &bdev->bd_disk->sync_io);
}

static inline void md_sync_acct_bio(struct bio *bio, unsigned long nr_sectors)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 3f8a21cd9233..d28b98adf457 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -170,7 +170,7 @@ struct gendisk {
struct list_head slave_bdevs;
#endif
struct timer_rand_state *random;
- atomic_t sync_io; /* RAID */
+ atomic64_t sync_io; /* RAID */
struct disk_events *ev;

#ifdef CONFIG_BLK_DEV_ZONED
diff --git a/drivers/md/md.c b/drivers/md/md.c
index c94373d64f2c..1d71b2a9af03 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -8496,14 +8496,15 @@ static int is_mddev_idle(struct mddev *mddev, int init)
{
struct md_rdev *rdev;
int idle;
- int curr_events;
+ long long curr_events;

idle = 1;
rcu_read_lock();
rdev_for_each_rcu(rdev, mddev) {
struct gendisk *disk = rdev->bdev->bd_disk;
- curr_events = (int)part_stat_read_accum(disk->part0, sectors) -
- atomic_read(&disk->sync_io);
+ curr_events =
+ (long long)part_stat_read_accum(disk->part0, sectors) -
+ atomic64_read(&disk->sync_io);
/* sync IO will cause sync_io to increase before the disk_stats
* as sync_io is counted when a request starts, and
* disk_stats is counted when it completes.
--
2.39.2

2023-12-11 18:00:58

by kernel test robot

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

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: i386-buildonly-randconfig-003-20231211 (https://download.01.org/0day-ci/archive/20231212/[email protected]/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231212/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All error/warnings (new ones prefixed by >>):

In file included from drivers/md/md-faulty.c:60:
>> drivers/md/md.h:587:28: error: character <U+2014> not allowed in an identifier
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
11 errors generated.
--
In file included from drivers/md/md-bitmap.c:32:
>> drivers/md/md.h:587:28: error: character <U+2014> not allowed in an identifier
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md-bitmap.c:2601:34: warning: result of comparison of constant 4294967296 with expression of type 'unsigned long' is always false [-Wtautological-constant-out-of-range-compare]
if (BITS_PER_LONG > 32 && csize >= (1ULL << (BITS_PER_BYTE *
~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 11 errors generated.
--
In file included from drivers/md/md.c:69:
>> drivers/md/md.h:587:28: error: character <U+2014> not allowed in an identifier
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.c:8517:29: error: character <U+2014> not allowed in an identifier
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.c:8517:25: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.c:8517:33: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.c:8517:25: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.c:8517:33: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.c:8517:25: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.c:8517:33: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.c:8517:25: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
--
In file included from drivers/md/raid5.c:53:
>> drivers/md/md.h:587:28: error: character <U+2014> not allowed in an identifier
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:24: error: use of undeclared identifier 'disk—'
if (blk_queue_io_stat(disk—>queue))
^
>> drivers/md/md.h:587:32: error: use of undeclared identifier 'queue'
if (blk_queue_io_stat(disk—>queue))
^
drivers/md/raid5.c:4265:7: warning: variable 'qread' set but not used [-Wunused-but-set-variable]
int qread =0;
^
1 warning and 11 errors generated.


vim +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

2023-12-11 21:43:26

by kernel test robot

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

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/[email protected]/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231212/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

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