public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Zhihao Cheng <chengzhihao1@huawei.com>
To: Jan Kara <jack@suse.cz>
Cc: <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 20:01:46 +0800	[thread overview]
Message-ID: <b7d108d6-9e5a-d88a-305d-932e75098b09@huawei.com> (raw)
In-Reply-To: <20230314113342.74g2pfwe5y7b5poa@quack3>

在 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.

>> -	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?
> 

  reply	other threads:[~2023-03-14 12:24 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 [this message]
2023-03-14 12:11       ` Jan Kara
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=b7d108d6-9e5a-d88a-305d-932e75098b09@huawei.com \
    --to=chengzhihao1@huawei.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=jack@suse.com \
    --cc=jack@suse.cz \
    --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