floppy: call disk_force_media_change when changing the format
authorChristoph Hellwig <hch@lst.de>
Fri, 11 Aug 2023 10:08:20 +0000 (12:08 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 21 Aug 2023 12:35:31 +0000 (14:35 +0200)
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>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Message-Id: <20230811100828.1897174-10-hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
drivers/block/floppy.c

index 2db9b18..ea4eb88 100644 (file)
@@ -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 {