[bvanassche:md-raid10 1/1] drivers/md/raid10.c:2648:17: error: 'rw' undeclared; did you mean 'rq'?

From: kernel test robot
Date: Tue Aug 09 2022 - 20:03:15 EST


tree: https://github.com/bvanassche/linux md-raid10
head: 31d1ab290843e8d1c00cfdbdd7bfccb907f5d64c
commit: 31d1ab290843e8d1c00cfdbdd7bfccb907f5d64c [1/1] md/raid10: Fix a recently introduced sparse warning
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220810/202208100709.3WYowHQE-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/bvanassche/linux/commit/31d1ab290843e8d1c00cfdbdd7bfccb907f5d64c
git remote add bvanassche https://github.com/bvanassche/linux
git fetch --no-tags bvanassche md-raid10
git checkout 31d1ab290843e8d1c00cfdbdd7bfccb907f5d64c
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

drivers/md/raid10.c: In function 'r10_sync_page_io':
>> drivers/md/raid10.c:2648:17: error: 'rw' undeclared (first use in this function); did you mean 'rq'?
2648 | && (rw == READ || test_bit(WriteErrorSeen, &rdev->flags)))
| ^~
| rq
drivers/md/raid10.c:2648:17: note: each undeclared identifier is reported only once for each function it appears in


vim +2648 drivers/md/raid10.c

1e50915fe0bbf7 Robert Becker 2009-12-14 2640
3cb03002000f13 NeilBrown 2011-10-11 2641 static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector,
31d1ab290843e8 Bart Van Assche 2022-08-09 2642 int sectors, struct page *page, enum req_op op)
58c54fcca3bac5 NeilBrown 2011-07-28 2643 {
58c54fcca3bac5 NeilBrown 2011-07-28 2644 sector_t first_bad;
58c54fcca3bac5 NeilBrown 2011-07-28 2645 int bad_sectors;
58c54fcca3bac5 NeilBrown 2011-07-28 2646
58c54fcca3bac5 NeilBrown 2011-07-28 2647 if (is_badblock(rdev, sector, sectors, &first_bad, &bad_sectors)
58c54fcca3bac5 NeilBrown 2011-07-28 @2648 && (rw == READ || test_bit(WriteErrorSeen, &rdev->flags)))
58c54fcca3bac5 NeilBrown 2011-07-28 2649 return -1;
31d1ab290843e8 Bart Van Assche 2022-08-09 2650 if (sync_page_io(rdev, sector, sectors << 9, page, op, false))
58c54fcca3bac5 NeilBrown 2011-07-28 2651 /* success */
58c54fcca3bac5 NeilBrown 2011-07-28 2652 return 1;
b7044d41b5a09c NeilBrown 2011-12-23 2653 if (rw == WRITE) {
58c54fcca3bac5 NeilBrown 2011-07-28 2654 set_bit(WriteErrorSeen, &rdev->flags);
b7044d41b5a09c NeilBrown 2011-12-23 2655 if (!test_and_set_bit(WantReplacement, &rdev->flags))
b7044d41b5a09c NeilBrown 2011-12-23 2656 set_bit(MD_RECOVERY_NEEDED,
b7044d41b5a09c NeilBrown 2011-12-23 2657 &rdev->mddev->recovery);
b7044d41b5a09c NeilBrown 2011-12-23 2658 }
58c54fcca3bac5 NeilBrown 2011-07-28 2659 /* need to record an error - either for the block or the device */
58c54fcca3bac5 NeilBrown 2011-07-28 2660 if (!rdev_set_badblocks(rdev, sector, sectors, 0))
58c54fcca3bac5 NeilBrown 2011-07-28 2661 md_error(rdev->mddev, rdev);
58c54fcca3bac5 NeilBrown 2011-07-28 2662 return 0;
58c54fcca3bac5 NeilBrown 2011-07-28 2663 }
58c54fcca3bac5 NeilBrown 2011-07-28 2664

:::::: The code at line 2648 was first introduced by commit
:::::: 58c54fcca3bac5bf9290cfed31c76e4c4bfbabaf md/raid10: handle further errors during fix_read_error better.

:::::: TO: NeilBrown <neilb@xxxxxxx>
:::::: CC: NeilBrown <neilb@xxxxxxx>

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