linux/drivers/block
Xie Yongji 435c2acb30 nbd: Use invalidate_disk() helper on disconnect
When a nbd device encounters a writeback error, that error will
get propagated to the bd_inode's wb_err field. Then if this nbd
device's backend is disconnected and another is attached, we will
get back the previous writeback error on fsync, which is unexpected.

To fix it, let's use invalidate_disk() helper to invalidate the
disk on disconnect instead of just setting disk's capacity to zero.

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210922123711.187-5-xieyongji@bytedance.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-10-21 10:12:41 -06:00
..
aoe for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00
drbd block: switch polling to be bio based 2021-10-18 06:17:36 -06:00
mtip32xx mtip32xx: use blk_mq_alloc_disk and blk_cleanup_disk 2021-06-30 15:34:04 -06:00
null_blk block: switch polling to be bio based 2021-10-18 06:17:36 -06:00
paride SCSI misc on 20210902 2021-09-02 15:09:46 -07:00
rnbd block: add a struct io_comp_batch argument to fops->iopoll() 2021-10-18 14:40:40 -06:00
rsxx block: switch polling to be bio based 2021-10-18 06:17:36 -06:00
xen-blkback isystem: trim/fixup stdarg.h and other headers 2021-08-19 09:02:55 +09:00
zram block: switch polling to be bio based 2021-10-18 06:17:36 -06:00
amiflop.c block: drop unused includes in <linux/genhd.h> 2021-10-18 06:17:02 -06:00
ataflop.c block: drop unused includes in <linux/genhd.h> 2021-10-18 06:17:02 -06:00
brd.c block: switch polling to be bio based 2021-10-18 06:17:36 -06:00
cryptoloop.c cryptoloop: add a deprecation warning 2021-08-27 10:44:54 -06:00
floppy.c block: drop unused includes in <linux/genhd.h> 2021-10-18 06:17:02 -06:00
Kconfig SCSI misc on 20210902 2021-09-02 15:09:46 -07:00
loop.c loop: Remove the unnecessary bdev checks and unused bdev variable 2021-10-21 10:12:41 -06:00
loop.h loop: reduce the loop_ctl_mutex scope 2021-09-03 22:14:40 -06:00
Makefile drivers/block: remove the umem driver 2021-03-24 06:57:40 -06:00
n64cart.c block: switch polling to be bio based 2021-10-18 06:17:36 -06:00
nbd.c nbd: Use invalidate_disk() helper on disconnect 2021-10-21 10:12:41 -06:00
pktcdvd.c block: switch polling to be bio based 2021-10-18 06:17:36 -06:00
ps3disk.c ps3disk: use memcpy_{from,to}_bvec 2021-08-02 13:37:27 -06:00
ps3vram.c block: switch polling to be bio based 2021-10-18 06:17:36 -06:00
rbd_types.h
rbd.c block: Rename BLKDEV_MAX_RQ -> BLKDEV_DEFAULT_RQ 2021-10-18 06:17:02 -06:00
sunvdc.c Char / Misc driver updates for 5.14-rc1 2021-07-05 13:42:16 -07:00
swim3.c swim3: use blk_mq_alloc_disk 2021-06-11 11:53:02 -06:00
swim_asm.S
swim.c block: drop unused includes in <linux/genhd.h> 2021-10-18 06:17:02 -06:00
sx8.c sx8: use the internal state machine to check if del_gendisk needs to be called 2021-08-12 10:29:36 -06:00
virtio_blk.c Revert "virtio-blk: Add validation for block size in config space" 2021-10-13 08:35:36 -04:00
xen-blkfront.c block: drop unused includes in <linux/genhd.h> 2021-10-18 06:17:02 -06:00
z2ram.c for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00