linux/fs/ext4
Baokun Li 58fd191f99 ext4: make data=journal support large block size
Currently, ext4_set_inode_mapping_order() does not set max folio order
for files with the data journalling flag. For files that already have
large folios enabled, ext4_inode_journal_mode() ignores the data
journalling flag once max folio order is set.

This is not because data journalling cannot work with large folios, but
because credit estimates will go through the roof if there are too many
blocks per folio.

Since the real constraint is blocks-per-folio, to support data=journal
under LBS, we now set max folio order to be equal to min folio order for
files with the journalling flag. When LBS is disabled, the max folio order
remains unset as before.

Therefore, before ext4_change_inode_journal_flag() switches the journalling
mode, we call truncate_pagecache() to drop all page cache for that inode,
and filemap_write_and_wait() is called unconditionally.

After that, once the journalling mode has been switched, we can safely
reset the inode mapping order, and the mapping_large_folio_support() check
in ext4_inode_journal_mode() can be removed.

Suggested-by: Jan Kara <jack@suse.cz>
Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Message-ID: <20251121090654.631996-22-libaokun@huaweicloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2025-11-28 22:35:28 -05:00
..
.kunitconfig
Kconfig ext4: remove obsolete EXT3 config options 2025-09-25 14:47:05 -04:00
Makefile
acl.c ext4: convert to ctime accessor functions 2023-07-24 10:29:54 +02:00
acl.h Revert "ext4: apply umask if ACL support is disabled" 2024-05-02 18:25:39 -04:00
balloc.c fs/ext4: fix typo in comment 2025-11-26 17:13:34 -05:00
bitmap.c ext4: remove sbi argument from ext4_chksum() 2025-05-20 10:31:12 -04:00
block_validity.c ext4: make block validity check resistent to sb bh corruption 2025-04-12 22:01:37 -04:00
crypto.c ext4: move crypt info pointer to fs-specific part of inode 2025-08-21 13:58:07 +02:00
dir.c ext4: support large block size in ext4_readdir() 2025-11-28 22:35:26 -05:00
ext4.h ext4: add EXT4_LBLK_TO_PG and EXT4_PG_TO_LBLK for block/page conversion 2025-11-28 22:35:27 -05:00
ext4_extents.h ext4: remove unused EXT_STATS macro from ext4_extents.h 2025-07-12 19:01:38 -04:00
ext4_jbd2.c ext4: make data=journal support large block size 2025-11-28 22:35:28 -05:00
ext4_jbd2.h ext4/jbd2: convert jbd2_journal_blocks_per_page() to support large folio 2025-05-20 10:31:12 -04:00
extents.c ext4: add EXT4_LBLK_TO_B macro for logical block to bytes conversion 2025-11-28 22:35:27 -05:00
extents_status.c ext4: make ext4_es_lookup_extent() pass out the extent seq counter 2025-11-06 10:44:39 -05:00
extents_status.h ext4: make ext4_es_lookup_extent() pass out the extent seq counter 2025-11-06 10:44:39 -05:00
fast_commit.c ext4: increase IO priority of fastcommit 2025-09-25 14:56:31 -04:00
fast_commit.h ext4 fast_commit: make use of name_snapshot primitives 2025-01-27 19:24:43 -05:00
file.c ext4: fix checks for orphan inodes 2025-09-26 08:36:08 -04:00
fsmap.c ext4: correctly handle queries for metadata mappings 2025-09-25 23:04:48 -04:00
fsmap.h
fsync.c ext4: add ext4_emergency_state() helper function 2025-03-13 10:16:34 -04:00
hash.c ext4: make error code in __ext4fs_dirhash() consistent. 2025-11-06 10:32:33 -05:00
ialloc.c ext4: clear i_state_flags when alloc inode 2025-11-26 17:06:09 -05:00
indirect.c ext4: add ext4_sb_bread_nofail() helper function for ext4_free_branches() 2025-09-25 14:36:54 -04:00
inline.c ext4: add i_data_sem protection in ext4_destroy_inline_data_nolock() 2025-11-26 17:06:24 -05:00
inode-test.c ext4: add missing MODULE_DESCRIPTION() 2024-07-05 16:07:24 -04:00
inode.c ext4: make data=journal support large block size 2025-11-28 22:35:28 -05:00
ioctl.c ext4: check if mount_opts is NUL-terminated in ext4_ioctl_set_tune_sb() 2025-11-26 17:05:39 -05:00
mballoc-test.c ext4: convert free groups order lists to xarrays 2025-07-25 09:14:17 -04:00
mballoc.c ext4: rename 'page' references to 'folio' in multi-block allocator 2025-11-28 22:35:27 -05:00
mballoc.h ext4: refactor choose group to scan group 2025-07-25 09:14:17 -04:00
migrate.c ext4: fix i_data_sem unlock order in ext4_ind_migrate() 2024-09-03 22:14:17 -04:00
mmp.c ext4: replace min/max nesting with clamp() 2025-09-25 14:35:21 -04:00
move_extent.c ext4: add two trace points for moving extents 2025-11-06 10:44:39 -05:00
namei.c ext4: add EXT4_LBLK_TO_B macro for logical block to bytes conversion 2025-11-28 22:35:27 -05:00
orphan.c ext4: align max orphan file size with e2fsprogs limit 2025-11-26 17:13:34 -05:00
page-io.c ext4: remove redundant __GFP_NOWARN 2025-08-12 23:15:05 -04:00
readpage.c ext4: support large block size in ext4_mpage_readpages() 2025-11-28 22:35:27 -05:00
resize.c ext4: remove sb argument from ext4_superblock_csum() 2025-05-20 10:31:12 -04:00
super.c ext4: support large block size in ext4_calculate_overhead() 2025-11-28 22:35:26 -05:00
symlink.c ext4_get_link(): fix breakage in RCU mode 2024-02-25 02:10:32 -05:00
sysfs.c ext4: Make sb update interval tunable 2025-03-21 01:12:33 -04:00
truncate.h
verity.c ext4: add EXT4_LBLK_TO_B macro for logical block to bytes conversion 2025-11-28 22:35:27 -05:00
xattr.c ext4: xattr: fix null pointer deref in ext4_raw_inode() 2025-11-13 08:33:22 -05:00
xattr.h ext4: fix out-of-bound read in ext4_xattr_inode_dec_ref_all() 2025-03-18 00:15:19 -04:00
xattr_hurd.c
xattr_security.c
xattr_trusted.c
xattr_user.c