[song-md:md-next 5/6] drivers/md/raid10.c:1526:8-27: atomic_dec_and_test variation before object free at line 1532.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://git.kernel.org/pub/scm/linux/kernel/git/song/md.git md-next
head:   49c4d345c81f149a29b3db6e521e5191e55f02b6
commit: f3cf8c2b2caf6ae77b7c786218d3b060faef63a6 [5/6] md/raid10: improve discard request for far layout
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

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


"coccinelle warnings: (new ones prefixed by >>)"
>> drivers/md/raid10.c:1526:8-27: atomic_dec_and_test variation before object free at line 1532.
   drivers/md/raid10.c:1526:8-27: atomic_dec_and_test variation before object free at line 1537.

vim +1526 drivers/md/raid10.c

  1520	
  1521	static void raid_end_discard_bio(struct r10bio *r10bio)
  1522	{
  1523		struct r10conf *conf = r10bio->mddev->private;
  1524		struct r10bio *first_r10bio;
  1525	
> 1526		while (atomic_dec_and_test(&r10bio->remaining)) {
  1527	
  1528			allow_barrier(conf);
  1529	
  1530			if (!test_bit(R10BIO_Discard, &r10bio->state)) {
  1531				first_r10bio = (struct r10bio *)r10bio->master_bio;
> 1532				free_r10bio(r10bio);
  1533				r10bio = first_r10bio;
  1534			} else {
  1535				md_write_end(r10bio->mddev);
  1536				bio_endio(r10bio->master_bio);
  1537				free_r10bio(r10bio);
  1538				break;
  1539			}
  1540		}
  1541	}
  1542	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux