From: Jan Kara <jack@suse.cz>
To: Zhihao Cheng <chengzhihao1@huawei.com>
Cc: Jan Kara <jack@suse.cz>,
tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.com,
tudor.ambarus@linaro.org, linux-ext4@vger.kernel.org,
linux-kernel@vger.kernel.org, yi.zhang@huawei.com
Subject: Re: [PATCH v2 1/5] ext4: Fix reusing stale buffer heads from last failed mounting
Date: Tue, 14 Mar 2023 13:11:25 +0100 [thread overview]
Message-ID: <20230314121125.tnz22hckcaj46kp6@quack3> (raw)
In-Reply-To: <b7d108d6-9e5a-d88a-305d-932e75098b09@huawei.com>
On Tue 14-03-23 20:01:46, Zhihao Cheng wrote:
> 在 2023/3/14 19:33, Jan Kara 写道:
> Hi Jan,
>
> >
> > > @@ -1271,14 +1277,8 @@ static void ext4_put_super(struct super_block *sb)
> > > sync_blockdev(sb->s_bdev);
> > > invalidate_bdev(sb->s_bdev);
>
> For journal in the inode case, journal bhs come from block device, which
> means buffers will be dropped after this line 'invalidate_bdev(sb->s_bdev)'
> being executed.
Right, I've missed that. But then why do you remove the sbi->s_journal_bdev
!= sb->s_bdev condition below?
> > > - if (sbi->s_journal_bdev && sbi->s_journal_bdev != sb->s_bdev) {
> > > - /*
> > > - * Invalidate the journal device's buffers. We don't want them
> > > - * floating about in memory - the physical journal device may
> > > - * hotswapped, and it breaks the `ro-after' testing code.
> > > - */
> > > + if (sbi->s_journal_bdev) {
> > > sync_blockdev(sbi->s_journal_bdev);
> > > - invalidate_bdev(sbi->s_journal_bdev);
> > > ext4_blkdev_remove(sbi);
> > > }
> > > Hum, but this will invalidate bhs only if journal is stored on a block
> > device. If journal is in the inode (the common case), we won't invalidate
> > anything (sbi->s_journal_bdev is NULL) and the same problem can happen?
> >
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2023-03-14 12:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-13 13:20 [PATCH v2 0/5] ext4: Fix stale buffer loading from last failed Zhihao Cheng
2023-03-13 13:20 ` [PATCH v2 1/5] ext4: Fix reusing stale buffer heads from last failed mounting Zhihao Cheng
2023-03-14 11:33 ` Jan Kara
2023-03-14 12:01 ` Zhihao Cheng
2023-03-14 12:11 ` Jan Kara [this message]
2023-03-14 12:31 ` Zhihao Cheng
2023-03-14 14:28 ` Jan Kara
2023-03-14 14:37 ` Zhihao Cheng
2023-03-13 13:20 ` [PATCH v2 2/5] jbd2: remove unused feature macros Zhihao Cheng
2023-03-14 11:35 ` Jan Kara
2023-03-14 12:02 ` Zhihao Cheng
2023-03-13 13:20 ` [PATCH v2 3/5] jbd2: switch to check format version in superblock directly Zhihao Cheng
2023-03-13 13:20 ` [PATCH v2 4/5] jbd2: factor out journal initialization from journal_get_superblock() Zhihao Cheng
2023-03-13 13:20 ` [PATCH v2 5/5] jbd2: remove j_format_version Zhihao Cheng
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=20230314121125.tnz22hckcaj46kp6@quack3 \
--to=jack@suse.cz \
--cc=adilger.kernel@dilger.ca \
--cc=chengzhihao1@huawei.com \
--cc=jack@suse.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tudor.ambarus@linaro.org \
--cc=tytso@mit.edu \
--cc=yi.zhang@huawei.com \
/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