On Tue, 29 Apr 2025 19:55:36 +0200, Jan Kara wrote: > Luis and David are reporting that after running generic/750 test for 90+ > hours on 2k ext4 filesystem, they are able to trigger a warning in > jbd2_journal_dirty_metadata() complaining that there are not enough > credits in the running transaction started in ext4_do_writepages(). > > Indeed the code in ext4_do_writepages() is racy and the extent tree can > change between the time we compute credits necessary for extent tree > computation and the time we actually modify the extent tree. Thus it may > happen that the number of credits actually needed is higher. Modify > ext4_ext_index_trans_blocks() to count with the worst case of maximum > tree depth. This can reduce the possible number of writers that can > operate in the system in parallel (because the credit estimates now won't > fit in one transaction) but for reasonably sized journals this shouldn't > really be an issue. So just go with a safe and simple fix. > > [...] Applied, thanks! [1/1] ext4: Fix calculation of credits for extent tree modification commit: 32a93f5bc9b9812fc710f43a4d8a6830f91e4988 Best regards, -- Theodore Ts'o <tytso@xxxxxxx>