From: Jan Kara <jack@suse.cz>
To: zhangshida <starzhangzsd@gmail.com>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.com,
ebiggers@kernel.org, linux-ext4@vger.kernel.org,
linux-kernel@vger.kernel.org, zhangshida@kylinos.cn,
Jan Kara <jack@suse.cz>
Subject: Re: [PATCH 4/4] ext4: remove the special buffer dirty handling in do_journal_get_write_access
Date: Mon, 2 Sep 2024 15:35:46 +0200 [thread overview]
Message-ID: <20240902133546.wify64w2yif7vvh5@quack3> (raw)
In-Reply-To: <20240830053739.3588573-5-zhangshida@kylinos.cn>
On Fri 30-08-24 13:37:39, zhangshida wrote:
> From: Shida Zhang <zhangshida@kylinos.cn>
>
> This kinda revert the commit 56d35a4cd13e("ext4: Fix dirtying of
> journalled buffers in data=journal mode") made by Jan 14 years ago,
> since the do_get_write_access() itself can deal with the extra
> unexpected buf dirting things in a proper way now.
>
> Suggested-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/ext4/inode.c | 18 +-----------------
> 1 file changed, 1 insertion(+), 17 deletions(-)
>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index a28f279fd02f..2687bf451a25 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -1023,27 +1023,11 @@ static int ext4_dirty_journalled_data(handle_t *handle, struct buffer_head *bh)
> int do_journal_get_write_access(handle_t *handle, struct inode *inode,
> struct buffer_head *bh)
> {
> - int dirty = buffer_dirty(bh);
> - int ret;
> -
> if (!buffer_mapped(bh) || buffer_freed(bh))
> return 0;
> - /*
> - * ext4_block_write_begin() could have dirtied some buffers. Clean
> - * the dirty bit as jbd2_journal_get_write_access() could complain
> - * otherwise about fs integrity issues. Setting of the dirty bit
> - * by ext4_block_write_begin() isn't a real problem here as we clear
> - * the bit before releasing a page lock and thus writeback cannot
> - * ever write the buffer.
> - */
> - if (dirty)
> - clear_buffer_dirty(bh);
> BUFFER_TRACE(bh, "get write access");
> - ret = ext4_journal_get_write_access(handle, inode->i_sb, bh,
> + return ext4_journal_get_write_access(handle, inode->i_sb, bh,
> EXT4_JTR_NONE);
> - if (!ret && dirty)
> - ret = ext4_dirty_journalled_data(handle, bh);
> - return ret;
> }
>
> int ext4_block_write_begin(handle_t *handle, struct folio *folio,
> --
> 2.33.0
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2024-09-02 13:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-30 5:37 [PATCH v6 0/4] Fix an error caused by improperly dirtied buffer zhangshida
2024-08-30 5:37 ` [PATCH 1/4] ext4: persist the new uptodate buffers in ext4_journalled_zero_new_buffers zhangshida
2024-08-30 5:37 ` [PATCH 2/4] ext4: hoist ext4_block_write_begin and replace the __block_write_begin zhangshida
2024-08-30 5:37 ` [PATCH 3/4] ext4: fix a potential assertion failure due to improperly dirtied buffer zhangshida
2024-09-02 13:34 ` Jan Kara
2024-08-30 5:37 ` [PATCH 4/4] ext4: remove the special buffer dirty handling in do_journal_get_write_access zhangshida
2024-09-02 13:35 ` Jan Kara [this message]
2024-09-05 14:53 ` [PATCH v6 0/4] Fix an error caused by improperly dirtied buffer 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=20240902133546.wify64w2yif7vvh5@quack3 \
--to=jack@suse.cz \
--cc=adilger.kernel@dilger.ca \
--cc=ebiggers@kernel.org \
--cc=jack@suse.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=starzhangzsd@gmail.com \
--cc=tytso@mit.edu \
--cc=zhangshida@kylinos.cn \
/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