android_kernel_motorola_sm6375/fs/ext4
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jan Kara 922200f03b ext4: fix calculation of credits for extent tree modification
commit 32a93f5bc9b9812fc710f43a4d8a6830f91e4988 upstream.

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.

Link: https://lore.kernel.org/all/20250415013641.f2ppw6wov4kn4wq2@offworld
Reported-by: Davidlohr Bueso <dave@stgolabs.net>
Reported-by: Luis Chamberlain <mcgrof@kernel.org>
Tested-by: kdevops@lists.linux.dev
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Link: https://patch.msgid.link/20250429175535.23125-2-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-27 11:02:51 +01:00
..
acl.c
acl.h ext4: apply umask if ACL support is disabled 2023-11-28 16:50:21 +00:00
balloc.c ext4: reorder capability check last 2025-06-04 14:32:31 +02:00
bitmap.c
block_validity.c
dir.c ext4: fix OOB read when checking dotdot dir 2025-05-02 07:39:24 +02:00
ext4.h ext4: avoid ext4_error()'s caused by ENOMEM in the truncate path 2025-02-01 18:18:53 +01:00
ext4_extents.h
ext4_jbd2.c
ext4_jbd2.h
extents.c ext4: fix calculation of credits for extent tree modification 2025-06-27 11:02:51 +01:00
extents_status.c ext4: make sure allocate pending entry not fail 2023-12-08 08:44:24 +01:00
extents_status.h
file.c ext4: avoid crash when inline data creation follows DIO write 2022-10-26 13:22:18 +02:00
fsmap.c ext4: fix FS_IOC_GETFSMAP handling 2024-12-14 19:44:35 +01:00
fsmap.h
fsync.c
hash.c
ialloc.c ext4: avoid negative min_clusters in find_group_orlov() 2024-11-08 16:20:30 +01:00
indirect.c ext4: only update i_reserved_data_blocks on successful block allocation 2023-07-27 08:37:35 +02:00
inline.c ext4: inline: fix len overflow in ext4_prepare_inline_data 2025-06-27 11:02:51 +01:00
inode.c ext4: don't treat fhandle lookup of ea_inode as FS corruption 2025-05-02 07:39:13 +02:00
ioctl.c ext4: fix to check return value of freeze_bdev() in ext4_shutdown() 2023-08-11 11:53:47 +02:00
Kconfig
Makefile
mballoc.c ext4: fix FS_IOC_GETFSMAP handling 2024-12-14 19:44:35 +01:00
mballoc.h ext4: fix FS_IOC_GETFSMAP handling 2024-12-14 19:44:35 +01:00
migrate.c ext4: fix i_data_sem unlock order in ext4_ind_migrate() 2024-11-08 16:20:39 +01:00
mmp.c
move_extent.c ext4: fix double-free of blocks due to wrong extents moved_len 2024-02-23 08:25:11 +01:00
namei.c ext4: fix off-by-one error in do_split 2025-05-02 07:39:15 +02:00
page-io.c ext4: fix cgroup writeback accounting with fs-layer encryption 2023-03-22 13:28:03 +01:00
readpage.c
resize.c ext4: fix corruption during on-line resize 2024-04-13 12:51:26 +02:00
super.c ext4: don't over-report free space or inodes in statvfs 2025-05-02 07:39:24 +02:00
symlink.c
sysfs.c ext4: Fix function prototype mismatch for ext4_feat_ktype 2023-02-25 11:53:27 +01:00
truncate.h
verity.c fs: ext4: initialize fsdata in pagecache_write() 2023-01-18 11:41:55 +01:00
xattr.c ext4: ignore xattrs past end 2025-05-02 07:39:11 +02:00
xattr.h ext4: remove duplicate definition of ext4_xattr_ibody_inline_set() 2023-04-26 11:24:05 +02:00
xattr_security.c
xattr_trusted.c
xattr_user.c