[PATCH 09/17] floppy: call disk_force_media_change when changing the format
- To: Al Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>
- Cc: Jens Axboe <axboe@kernel.dk>, Denis Efremov <efremov@linux.com>, Josef Bacik <josef@toxicpanda.com>, Stefan Haberland <sth@linux.ibm.com>, Jan Hoeppner <hoeppner@linux.ibm.com>, Heiko Carstens <hca@linux.ibm.com>, Vasily Gorbik <gor@linux.ibm.com>, Alexander Gordeev <agordeev@linux.ibm.com>, "Darrick J . Wong" <djwong@kernel.org>, Chris Mason <clm@fb.com>, David Sterba <dsterba@suse.com>, linux-block@vger.kernel.org, nbd@other.debian.org, linux-s390@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
- Subject: [PATCH 09/17] floppy: call disk_force_media_change when changing the format
- From: Christoph Hellwig <hch@lst.de>
- Date: Fri, 11 Aug 2023 12:08:20 +0200
- Message-id: <[🔎] 20230811100828.1897174-10-hch@lst.de>
- In-reply-to: <[🔎] 20230811100828.1897174-1-hch@lst.de>
- References: <[🔎] 20230811100828.1897174-1-hch@lst.de>
While changing the format of a floppy isn't strictly speaking a media
change, the effects are the same in that the content of the media
changes and the diskseq should be increased and uevent should be
sent. Switch from calling __invalidate_device to
disk_force_media_change to do so.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/floppy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 2db9b186b977ac..ea4eb88a2e45f4 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3255,7 +3255,7 @@ static int set_geometry(unsigned int cmd, struct floppy_struct *g,
if (!disk || ITYPE(drive_state[cnt].fd_device) != type)
continue;
- __invalidate_device(disk->part0, true);
+ disk_force_media_change(disk);
}
mutex_unlock(&open_lock);
} else {
--
2.39.2
Reply to: