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 1/2] ext4: Fix crash in ext4_bdev_mark_dead()
Date: Wed, 21 Jun 2023 16:47:42 +0200	[thread overview]
Message-ID: <20230621144744.1580-1-jack@suse.cz> (raw)
In-Reply-To: <20230621144354.10915-1-jack@suse.cz>

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

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

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 6f43a86ecf16..53d74144ee34 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1098,7 +1098,7 @@ void ext4_update_dynamic_rev(struct super_block *sb)
 
 static void ext4_bdev_mark_dead(struct block_device *bdev)
 {
-	ext4_force_shutdown(bdev->bd_holder, EXT4_GOING_FLAGS_NOLOGFLUSH);
+	ext4_force_shutdown(bdev->bd_super, EXT4_GOING_FLAGS_NOLOGFLUSH);
 }
 
 static const struct blk_holder_ops ext4_holder_ops = {
-- 
2.35.3


  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 ` Jan Kara [this message]
2023-06-21 14:52   ` [PATCH 1/2] ext4: Fix crash in ext4_bdev_mark_dead() Christoph Hellwig
2023-06-21 16:26     ` Jan Kara
2023-06-21 14:47 ` [PATCH 2/2] xfs: " Jan Kara
2023-06-21 14:53   ` 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-1-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