nbd: replace kill_bdev() with __invalidate_device()
authorRatna Manoj Bolla <manoj.br@gmail.com>
Fri, 24 Mar 2017 18:08:29 +0000 (14:08 -0400)
committerJens Axboe <axboe@fb.com>
Fri, 24 Mar 2017 21:42:47 +0000 (15:42 -0600)
commitabbbdf12497d36b001e0865bc5bc6cc363f3a5e1
treee0534687a8cf3b686bcff619320ec3258c8986bc
parentf8586855031a1d6b243f013c3082631346fddfad
nbd: replace kill_bdev() with __invalidate_device()

When a filesystem is mounted on a nbd device and on a disconnect, because
of kill_bdev(), and resetting bdev size to zero, buffer_head mappings are
getting destroyed under mounted filesystem.

After a bdev size reset(i.e bdev->bd_inode->i_size = 0) on a disconnect,
followed by a sys_umount(),
        generic_shutdown_super()->...
        ->__sync_blockdev()->...
        -blkdev_writepages()->...
        ->do_invalidatepage()->...
        -discard_buffer()   is discarding superblock buffer_head assumed
to be in mapped state by ext4_commit_super().

[mlin: ported to 4.11-rc2]
Signed-off-by: Ratna Manoj Bolla <manoj.br@gmail.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/nbd.c