Hi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on next-20200608]
[cannot apply to v5.7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see
https://stackoverflow.com/a/37406982]
url:
https://github.com/0day-ci/linux/commits/jeffm-suse-com/mdraid-fix-read-w...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
b170290c2836c40ab565736ba37681eb3dfd79b8
config: m68k-randconfig-r011-20200607 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
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 >>, old ones prefixed by <<):
drivers/md/md.c: In function 'md_make_request':
> drivers/md/md.c:485:15: warning: variable 'sectors' set
but not used [-Wunused-but-set-variable]
485 | unsigned int sectors;
| ^~~~~~~
drivers/md/md.c: In function 'bind_rdev_to_array':
drivers/md/md.c:2454:27: warning: suggest braces around empty body in an 'if'
statement [-Wempty-body]
2454 | /* failure here is OK */;
| ^
drivers/md/md.c: In function 'slot_store':
drivers/md/md.c:3215:28: warning: suggest braces around empty body in an 'if'
statement [-Wempty-body]
3215 | /* failure here is OK */;
| ^
drivers/md/md.c: In function 'remove_and_add_spares':
drivers/md/md.c:9073:29: warning: suggest braces around empty body in an 'if'
statement [-Wempty-body]
9073 | /* failure here is OK */;
| ^
vim +/sectors +485 drivers/md/md.c
eb17e42dfd959c Jeff Mahoney 2020-06-05 480
dece16353ef47d Jens Axboe 2015-11-05 481 static blk_qc_t
md_make_request(struct request_queue *q, struct bio *bio)
^1da177e4c3f41 Linus Torvalds 2005-04-16 482 {
490773268cf64f NeilBrown 2010-03-25 483 const int rw = bio_data_dir(bio);
e4fc5a74293fbe Christoph Hellwig 2020-05-08 484 struct mddev *mddev =
bio->bi_disk->private_data;
e91ece5590b3c7 Chris Mason 2011-02-07 @485 unsigned int sectors;
490773268cf64f NeilBrown 2010-03-25 486
62f7b1989c02fe Guilherme G. Piccoli 2019-09-03 487 if (unlikely(test_bit(MD_BROKEN,
&mddev->flags)) && (rw == WRITE)) {
62f7b1989c02fe Guilherme G. Piccoli 2019-09-03 488 bio_io_error(bio);
62f7b1989c02fe Guilherme G. Piccoli 2019-09-03 489 return BLK_QC_T_NONE;
62f7b1989c02fe Guilherme G. Piccoli 2019-09-03 490 }
62f7b1989c02fe Guilherme G. Piccoli 2019-09-03 491
af67c31fba3b87 NeilBrown 2017-06-18 492 blk_queue_split(q, &bio);
54efd50bfd873e Kent Overstreet 2015-04-23 493
274d8cbde1bc3b NeilBrown 2016-01-04 494 if (mddev == NULL || mddev->pers
== NULL) {
6712ecf8f64811 NeilBrown 2007-09-27 495 bio_io_error(bio);
dece16353ef47d Jens Axboe 2015-11-05 496 return BLK_QC_T_NONE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 497 }
bbfa57c0f2243a Sebastian Riemer 2013-02-21 498 if (mddev->ro == 1 &&
unlikely(rw == WRITE)) {
4246a0b63bd8f5 Christoph Hellwig 2015-07-20 499 if (bio_sectors(bio) != 0)
4e4cbee93d5613 Christoph Hellwig 2017-06-03 500 bio->bi_status =
BLK_STS_IOERR;
4246a0b63bd8f5 Christoph Hellwig 2015-07-20 501 bio_endio(bio);
dece16353ef47d Jens Axboe 2015-11-05 502 return BLK_QC_T_NONE;
bbfa57c0f2243a Sebastian Riemer 2013-02-21 503 }
490773268cf64f NeilBrown 2010-03-25 504
e91ece5590b3c7 Chris Mason 2011-02-07 505 /*
e91ece5590b3c7 Chris Mason 2011-02-07 506 * save the sectors now since our
bio can
e91ece5590b3c7 Chris Mason 2011-02-07 507 * go away inside make_request
e91ece5590b3c7 Chris Mason 2011-02-07 508 */
e91ece5590b3c7 Chris Mason 2011-02-07 509 sectors = bio_sectors(bio);
9c573de3283af0 Shaohua Li 2016-04-25 510 /* bio could be mergeable after
passing to underlayer */
1eff9d322a4442 Jens Axboe 2016-08-05 511 bio->bi_opf &= ~REQ_NOMERGE;
393debc23c7820 Shaohua Li 2017-09-21 512
393debc23c7820 Shaohua Li 2017-09-21 513 md_handle_request(mddev, bio);
490773268cf64f NeilBrown 2010-03-25 514
dece16353ef47d Jens Axboe 2015-11-05 515 return BLK_QC_T_NONE;
409c57f3801701 NeilBrown 2009-03-31 516 }
409c57f3801701 NeilBrown 2009-03-31 517
:::::: The code at line 485 was first introduced by commit
:::::: e91ece5590b3c728624ab57043fc7a05069c604a md_make_request: don't touch the bio
after calling make_request
:::::: TO: Chris Mason <chris.mason(a)oracle.com>
:::::: CC: NeilBrown <neilb(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org