CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Ignat Korchagin <[email protected]>
TO: [email protected]
TO: [email protected]
TO: [email protected]
TO: [email protected]
TO: [email protected]
CC: Ignat Korchagin <[email protected]>
CC: [email protected]
CC: [email protected]

Hi Ignat,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on dm/for-next]
[also build test WARNING on v5.11-rc2 next-20210108]
[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]

url:    
https://github.com/0day-ci/linux/commits/Ignat-Korchagin/dm-crypt-do-not-call-bio_endio-from-the-dm-crypt-tasklet/20210109-232233
base:   
https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git 
for-next
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago
config: i386-randconfig-c001-20210109 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Julia Lawall <[email protected]>


"coccinelle warnings: (new ones prefixed by >>)"
>> drivers/md/dm-crypt.c:1749:6-25: atomic_dec_and_test variation before object 
>> free at line 1777.

vim +1749 drivers/md/dm-crypt.c

bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1738  
^1da177e4c3f4152 Linus Torvalds    2005-04-16  1739  /*
^1da177e4c3f4152 Linus Torvalds    2005-04-16  1740   * One of the bios was 
finished. Check for completion of
^1da177e4c3f4152 Linus Torvalds    2005-04-16  1741   * the whole request and 
correctly clean up the buffer.
^1da177e4c3f4152 Linus Torvalds    2005-04-16  1742   */
5742fd77757894eb Milan Broz        2008-02-08  1743  static void 
crypt_dec_pending(struct dm_crypt_io *io)
^1da177e4c3f4152 Linus Torvalds    2005-04-16  1744  {
49a8a9204bb17296 Alasdair G Kergon 2012-07-27  1745     struct crypt_config *cc 
= io->cc;
b35f8caa08901690 Milan Broz        2009-03-16  1746     struct bio *base_bio = 
io->base_bio;
4e4cbee93d56137e Christoph Hellwig 2017-06-03  1747     blk_status_t error = 
io->error;
^1da177e4c3f4152 Linus Torvalds    2005-04-16  1748  
40b6229b69211e24 Mikulas Patocka   2012-07-27 @1749     if 
(!atomic_dec_and_test(&io->io_pending))
^1da177e4c3f4152 Linus Torvalds    2005-04-16  1750             return;
^1da177e4c3f4152 Linus Torvalds    2005-04-16  1751  
ef43aa38063a6b2b Milan Broz        2017-01-04  1752     if (io->ctx.r.req)
ef43aa38063a6b2b Milan Broz        2017-01-04  1753             
crypt_free_req(cc, io->ctx.r.req, base_bio);
ef43aa38063a6b2b Milan Broz        2017-01-04  1754  
ef43aa38063a6b2b Milan Broz        2017-01-04  1755     if 
(unlikely(io->integrity_metadata_from_pool))
6f1c819c219f7841 Kent Overstreet   2018-05-20  1756             
mempool_free(io->integrity_metadata, &io->cc->tag_pool);
ef43aa38063a6b2b Milan Broz        2017-01-04  1757     else
ef43aa38063a6b2b Milan Broz        2017-01-04  1758             
kfree(io->integrity_metadata);
b35f8caa08901690 Milan Broz        2009-03-16  1759  
4e4cbee93d56137e Christoph Hellwig 2017-06-03  1760     base_bio->bi_status = 
error;
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1761  
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1762     /*
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1763      * If we are running 
this function from our tasklet,
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1764      * we can't call 
bio_endio() here, because it will call
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1765      * clone_endio() from 
dm.c, which in turn will
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1766      * free the current 
struct dm_crypt_io structure with
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1767      * our tasklet. In this 
case we need to delay bio_endio()
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1768      * execution to after 
the tasklet is done and dequeued.
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1769      */
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1770     if 
(tasklet_trylock(&io->tasklet)) {
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1771             
tasklet_unlock(&io->tasklet);
4246a0b63bd8f56a Christoph Hellwig 2015-07-20  1772             
bio_endio(base_bio);
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1773             return;
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1774     }
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1775  
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09  1776     INIT_WORK(&io->work, 
kcryptd_io_bio_endio);
bd1a2775f222c5b6 Ignat Korchagin   2021-01-09 @1777     
queue_work(cc->io_queue, &io->work);
^1da177e4c3f4152 Linus Torvalds    2005-04-16  1778  }
^1da177e4c3f4152 Linus Torvalds    2005-04-16  1779  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to