public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Jens Axboe <axboe@kernel.dk>
Cc: <linux-block@vger.kernel.org>,
	Christoph Hellwig <hch@infradead.org>,
	<linux-ext4@vger.kernel.org>, <linux-xfs@vger.kernel.org>,
	Jan Kara <jack@suse.cz>
Subject: [PATCH 2/2] xfs: Fix crash in ext4_bdev_mark_dead()
Date: Wed, 21 Jun 2023 16:47:43 +0200	[thread overview]
Message-ID: <20230621144744.1580-2-jack@suse.cz> (raw)
In-Reply-To: <20230621144354.10915-1-jack@suse.cz>

xfs_bdev_mark_dead() passes bdev->bd_holder to ext4_force_shutdown()
instead of bdev->bd_super leading to crashes. Fix it.

Fixes: 8067ca1dcdfc ("xfs: wire up the ->mark_dead holder operation for log and RT devices")
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/xfs/xfs_super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index d910b141d52e..3ab188a6fba1 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -381,7 +381,7 @@ static void
 xfs_bdev_mark_dead(
 	struct block_device	*bdev)
 {
-	xfs_force_shutdown(bdev->bd_holder, SHUTDOWN_DEVICE_REMOVED);
+	xfs_force_shutdown(XFS_M(bdev->bd_super), SHUTDOWN_DEVICE_REMOVED);
 }
 
 static const struct blk_holder_ops xfs_holder_ops = {
-- 
2.35.3


  parent reply	other threads:[~2023-06-21 14:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21 14:47 [PATCH 0/2] fs: Fixup bdev_mark_dead callbacks for ext4 and xfs Jan Kara
2023-06-21 14:47 ` [PATCH 1/2] ext4: Fix crash in ext4_bdev_mark_dead() Jan Kara
2023-06-21 14:52   ` Christoph Hellwig
2023-06-21 16:26     ` Jan Kara
2023-06-21 14:47 ` Jan Kara [this message]
2023-06-21 14:53   ` [PATCH 2/2] xfs: " Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230621144744.1580-2-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox