From 2527fd38772fea30c1d1cbf94839a0bbf4122133 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 11 Aug 2023 12:08:22 +0200 Subject: [PATCH] dasd: also call __invalidate_device when setting the device offline Don't just write out the data, but also invalidate all caches when setting the device offline. Stop canceling the offlining when writeback fails as there is no way to recover from that anyway. Signed-off-by: Christoph Hellwig Reviewed-by: Josef Bacik Message-Id: <20230811100828.1897174-12-hch@lst.de> Signed-off-by: Christian Brauner --- drivers/s390/block/dasd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index edcbf77852c3..675b38ad00dc 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -3627,9 +3627,8 @@ int dasd_generic_set_offline(struct ccw_device *cdev) * empty */ if (device->block) { - rc = fsync_bdev(device->block->bdev); - if (rc != 0) - goto interrupted; + fsync_bdev(device->block->bdev); + __invalidate_device(device->block->bdev, true); } dasd_schedule_device_bh(device); rc = wait_event_interruptible(shutdown_waitq, -- 2.11.0