]> git.baikalelectronics.ru Git - kernel.git/commit
loop: replace kill_bdev with invalidate_bdev
authorZheng Bin <zhengbin13@huawei.com>
Thu, 18 Jun 2020 04:21:37 +0000 (12:21 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 18 Jun 2020 15:24:35 +0000 (09:24 -0600)
commit7676ac21c0ae0b6e4e9029e0344a49024bf6ff95
treef006235fc2d2c665077d6fabf8b971b81b55f1c7
parent757cc67e86c53300e5b4d8fc32742ba2bacee8a8
loop: replace kill_bdev with invalidate_bdev

When a filesystem is mounted on a loop device and on a loop ioctl
LOOP_SET_STATUS64, because of kill_bdev, buffer_head mappings are getting
destroyed.
kill_bdev
  truncate_inode_pages
    truncate_inode_pages_range
      do_invalidatepage
        block_invalidatepage
          discard_buffer  -->clear BH_Mapped flag

sb_bread
  __bread_gfp
  bh = __getblk_gfp
  -->discard_buffer clear BH_Mapped flag
  __bread_slow
    submit_bh
      submit_bh_wbc
        BUG_ON(!buffer_mapped(bh))  --> hit this BUG_ON

Fixes: eb500eb3b1dd ("loop: drop caches if offset or block_size are changed")
Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c