jbd2: make b_frozen_data allocation always succeed
authorZhihao Cheng <chengzhihao1@huawei.com>
Sat, 12 Oct 2024 08:55:30 +0000 (16:55 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 13 Nov 2024 04:54:15 +0000 (23:54 -0500)
commitabe1ac7ca84236513a3d8ede02cc47584437f24f
tree640a3702a0750d23e7e90ecc3126c87f9483e9fe
parent27349b4d2ed072cabedd5115f0542b3b7b538aa8
jbd2: make b_frozen_data allocation always succeed

The b_frozen_data allocation should not be failed during journal
committing process, otherwise jbd2 will abort.
Since commit 490c1b444ce653d("jbd2: do not fail journal because of
frozen_buffer allocation failure") already added '__GFP_NOFAIL' flag
in do_get_write_access(), just add '__GFP_NOFAIL' flag for all allocations
in jbd2_journal_write_metadata_buffer(), like 'new_bh' allocation does.
Besides, remove all error handling branches for do_get_write_access().

Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Link: https://patch.msgid.link/20241012085530.2147846-1-chengzhihao@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/jbd2/commit.c
fs/jbd2/journal.c