nbd: call blk_mark_disk_dead in nbd_clear_sock_ioctl
authorChristoph Hellwig <hch@lst.de>
Fri, 11 Aug 2023 10:08:18 +0000 (12:08 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 21 Aug 2023 12:35:30 +0000 (14:35 +0200)
commit0c1c9a27ce909e3988f8c6407e26a22a7e1cd276
treee9e5852342ab28344863057eb419a268eb71e397
parent8ffa54e3370c5a8b9538dbe4077fc9c4b5a08f45
nbd: call blk_mark_disk_dead in nbd_clear_sock_ioctl

nbd_clear_sock_ioctl kills the socket and with that the block
device.  Instead of just invalidating file system buffers,
mark the device as dead, which will also invalidate the buffers
as part of the proper shutdown sequence.  This also includes
invalidating partitions if there are any.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Message-Id: <20230811100828.1897174-8-hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
drivers/block/nbd.c