public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/4] Fix an error caused by improperly dirtied buffer
@ 2024-08-30  5:37 zhangshida
  2024-08-30  5:37 ` [PATCH 1/4] ext4: persist the new uptodate buffers in ext4_journalled_zero_new_buffers zhangshida
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: zhangshida @ 2024-08-30  5:37 UTC (permalink / raw)
  To: tytso, adilger.kernel, jack, ebiggers
  Cc: linux-ext4, linux-kernel, zhangshida, starzhangzsd

From: Shida Zhang <zhangshida@kylinos.cn>

Hi all,

On an old kernel version(4.19, ext3, data=journal, pagesize=64k),
an assertion failure will occasionally be triggered by the line below:
---------
jbd2_journal_commit_transaction
{
...
J_ASSERT_BH(bh, !buffer_dirty(bh));
/*
* The buffer on BJ_Forget list and not jbddirty means
...
}
---------

The same condition may also be applied to the lattest kernel version.

This patch set fixes it by: 
1.Fix a small bug for ext4_journalled_zero_new_buffers first.(patch 1)
2.Replace the __block_write_begin with the hoisted
  ext4_block_write_begin().(patch 2)
3.Trace the user data dirtying in ext4_block_write_begin().(patch 3)
4.Clean up some extra things.(patch 4)

Changes since v5: 
- Moved a hunk inside the if (buffer_new(bh)) check in patch 3.
- Add a cleanup in patch 4. 

[5] Version 5:
https://lore.kernel.org/linux-ext4/20240829085407.3331490-1-zhangshida@kylinos.cn/
Changes since v4: 
- At first, we fix a bug in ext4_journalled_zero_new_buffers, as suggested
  by Jan.
- In patch 2, clean up the related comment. And remove the #ifdef in  
  ext4_block_write_begin(), as suggested by Eric. 
- Add some comments in patch 3.

[4] Version 4:
https://lore.kernel.org/linux-ext4/20240823013329.1996741-1-zhangshida@kylinos.cn/
Changes since v3: 
- Ditch the patch 3 in v3, because some other code paths can set the 
  buffer dirty:
        ext4_write_begin
                ext4_block_write_begin
                        create_empty_buffers
                                set_buffer_dirty 

[3] Version 3:
https://lore.kernel.org/linux-ext4/20240810082814.3709867-1-zhangshida@kylinos.cn/
Changes since v2: 
- Adjust the applied order of patch 1 and patch 2 in v1. 
- Reword the commit message.
- Remove some superfluous logic in patch 2 and patch 3.

[2] Version 2:
https://lore.kernel.org/linux-ext4/20240809064606.3490994-2-zhangshida@kylinos.cn/
Changes since v1:
- v1 use a hack into jbd2 to fix the bug while v2 choose to journal
  the dirty data in *_block_write_begin.

[1] Version 1:
https://lore.kernel.org/linux-ext4/20240720062356.2522658-1-zhangshida@kylinos.cn/


Shida Zhang (4):
  ext4: persist the new uptodate buffers in
    ext4_journalled_zero_new_buffers
  ext4: hoist ext4_block_write_begin and replace the __block_write_begin
  ext4: fix a potential assertion failure due to improperly dirtied
    buffer
  ext4: remove the special buffer dirty handling in
    do_journal_get_write_access

 fs/ext4/ext4.h   |  3 ++
 fs/ext4/inline.c | 11 ++++---
 fs/ext4/inode.c  | 80 +++++++++++++++++++++++-------------------------
 3 files changed, 47 insertions(+), 47 deletions(-)

-- 
2.33.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-09-05 14:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-09-05 14:53 ` [PATCH v6 0/4] Fix an error caused by improperly dirtied buffer Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox