From: Jan Kara <jack@suse.cz>
To: Zhihao Cheng <chengzhihao1@huawei.com>
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 v3 2/6] ext4: ext4_put_super: Remove redundant checking for 'sbi->s_journal_bdev'
Date: Wed, 15 Mar 2023 09:44:03 +0100 [thread overview]
Message-ID: <20230315084403.krguix7veo4lsvgk@quack3> (raw)
In-Reply-To: <20230315013128.3911115-3-chengzhihao1@huawei.com>
On Wed 15-03-23 09:31:24, Zhihao Cheng wrote:
> As discussed in [1], 'sbi->s_journal_bdev != sb->s_bdev' will always
> become true if sbi->s_journal_bdev exists. Filesystem block device and
> journal block device are both opened with 'FMODE_EXCL' mode, so these
> two devices can't be same one. Then we can remove the redundant checking
> 'sbi->s_journal_bdev != sb->s_bdev' if 'sbi->s_journal_bdev' exists.
>
> [1] https://lore.kernel.org/lkml/f86584f6-3877-ff18-47a1-2efaa12d18b2@huawei.com/
>
> Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> 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 61511b7ba017..a22417d113ca 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -1277,7 +1277,7 @@ static void ext4_put_super(struct super_block *sb)
>
> sync_blockdev(sb->s_bdev);
> invalidate_bdev(sb->s_bdev);
> - if (sbi->s_journal_bdev && sbi->s_journal_bdev != sb->s_bdev) {
> + if (sbi->s_journal_bdev) {
> sync_blockdev(sbi->s_journal_bdev);
> ext4_blkdev_remove(sbi);
> }
> --
> 2.31.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2023-03-15 8:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-15 1:31 [PATCH v3 0/6] ext4: Fix stale buffer loading from last failed Zhihao Cheng
2023-03-15 1:31 ` [PATCH v3 1/6] ext4: Fix reusing stale buffer heads from last failed mounting Zhihao Cheng
2023-03-15 8:43 ` Jan Kara
2023-03-15 1:31 ` [PATCH v3 2/6] ext4: ext4_put_super: Remove redundant checking for 'sbi->s_journal_bdev' Zhihao Cheng
2023-03-15 8:44 ` Jan Kara [this message]
2023-03-15 1:31 ` [PATCH v3 3/6] jbd2: remove unused feature macros Zhihao Cheng
2023-03-15 1:31 ` [PATCH v3 4/6] jbd2: switch to check format version in superblock directly Zhihao Cheng
2023-03-15 1:31 ` [PATCH v3 5/6] jbd2: factor out journal initialization from journal_get_superblock() Zhihao Cheng
2023-03-15 1:31 ` [PATCH v3 6/6] jbd2: remove j_format_version Zhihao Cheng
2023-06-09 8:04 ` [PATCH v3 0/6] ext4: Fix stale buffer loading from last failed Zhihao Cheng
2023-06-11 4:42 ` Theodore Ts'o
2023-06-12 1:38 ` Zhihao Cheng
2023-06-15 14:59 ` Theodore Ts'o
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=20230315084403.krguix7veo4lsvgk@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