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:31:43 +0800 [thread overview]
Message-ID: <f86584f6-3877-ff18-47a1-2efaa12d18b2@huawei.com> (raw)
In-Reply-To: <20230314121125.tnz22hckcaj46kp6@quack3>
> 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?
>
I think 'sbi->s_journal_bdev != sb->s_bdev' always becomes true if
sbi->s_journal_bdev exists.
mount_bdev
fmode_t mode = FMODE_READ | FMODE_EXCL
bdev_a = blkdev_get_by_path(dev_name, mode, fs_type)
mount_bdev->ext4_fill_super->ext4_load_and_init_journal->ext4_load_journal->ext4_get_dev_journal:
bdev_b = ext4_blkdev_get(j_dev, sb)
bdev_b = blkdev_get_by_dev(dev, FMODE_READ|FMODE_WRITE|FMODE_EXCL, sb)
EXT4_SB(sb)->s_journal_bdev = bdev_b
bdev_a cannot be bdev_b, because bd_prepare_to_claim() makes sure the
same block device cannot be openned twice with mode 'FMODE_EXCL'.
next prev parent reply other threads:[~2023-03-14 12:56 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
2023-03-14 12:31 ` Zhihao Cheng [this message]
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=f86584f6-3877-ff18-47a1-2efaa12d18b2@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