From patchwork Fri Aug 11 10:08:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13350430 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62603C04A6A for ; Fri, 11 Aug 2023 10:10:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235733AbjHKKKS (ORCPT ); Fri, 11 Aug 2023 06:10:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233288AbjHKKJl (ORCPT ); Fri, 11 Aug 2023 06:09:41 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D49B3C1E; Fri, 11 Aug 2023 03:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=h0y45HSXMdqvAsXX+rWjCQySRpy/tzHE4F4xXnA9hUA=; b=X5N6D2RuIJPEACFdN87bByqqvJ nDb/0S8vM5RMj7KWJFBH9dRSEsy+APYfjAaTiF6M2sAxWoDhHeidLglhhFrGZQwKudhJzKh19bAbd DE+hk+Eip05VhTLNh4lGjQknDZ0/AAiyQ/qHcWLyq5iXy33xKctf765bORgQbXrlvINF4pSJ9VBf5 NOGbB5cuTGjmnp/c7b/YhDRHoi0oXqApTNi5I7eH9V9mk+dChbywou7rWIlB4B3k5JiGaNc4lqRIj qA/FAhDmCNpvgUae10Rjh/aNeh9jff95JVbPEU9KGhX81wE39DgChRpEqCmS7PgLY8tB3rEunaLAA jlXANyXg==; Received: from [88.128.92.63] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qUP4k-00A5lf-03; Fri, 11 Aug 2023 10:08:58 +0000 From: Christoph Hellwig To: Al Viro , Christian Brauner Cc: Jens Axboe , Denis Efremov , Josef Bacik , Stefan Haberland , Jan Hoeppner , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , "Darrick J . Wong" , Chris Mason , David Sterba , 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 Date: Fri, 11 Aug 2023 12:08:20 +0200 Message-Id: <20230811100828.1897174-10-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230811100828.1897174-1-hch@lst.de> References: <20230811100828.1897174-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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 --- 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 {