Skip to content

Commit cb01581

Browse files
committed
Merge tag 'f2fs-for-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs
Pull f2fs updates from Jaegeuk Kim: "This series focuses on minor clean-ups and performance optimizations across sysfs, documentation, debugfs, tracepoints, slab allocation, and GC. Furthermore, it resolves several corner-case bugs caught by xfstests, as well as issues related to 16KB page support and f2fs_enable_checkpoint. Enhancement: - wrap ASCII tables in literal blocks to fix LaTeX build - optimize trace_f2fs_write_checkpoint with enums - support to show curseg.next_blkoff in debugfs - add a sysfs entry to show max open zones - add fadvise tracepoint - use global inline_xattr_slab instead of per-sb slab cache - set default valid_thresh_ratio to 80 for zoned devices - maintain one time GC mode is enabled during whole zoned GC cycle Bug fix: - ensure node page reads complete before f2fs_put_super() finishes - do not account invalid blocks in get_left_section_blocks() - revert summary entry count from 2048 to 512 in 16kb block support - detect recoverable inode during dryrun of find_fsync_dnodes() - fix age extent cache insertion skip on counter overflow - add sanity checks before unlinking and loading inodes - ensure minimum trim granularity accounts for all devices - block cache/dio write during f2fs_enable_checkpoint() - propagate error from f2fs_enable_checkpoint() - invalidate dentry cache on failed whiteout creation - avoid updating compression context during writeback - avoid updating zero-sized extent in extent cache - avoid potential deadlock" * tag 'f2fs-for-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (39 commits) f2fs: ignore discard return value f2fs: optimize trace_f2fs_write_checkpoint with enums f2fs: fix to not account invalid blocks in get_left_section_blocks() f2fs: support to show curseg.next_blkoff in debugfs docs: f2fs: wrap ASCII tables in literal blocks to fix LaTeX build f2fs: expand scalability of f2fs mount option f2fs: change default schedule timeout value f2fs: introduce f2fs_schedule_timeout() f2fs: use memalloc_retry_wait() as much as possible f2fs: add a sysfs entry to show max open zones f2fs: wrap all unusable_blocks_per_sec code in CONFIG_BLK_DEV_ZONED f2fs: simplify list initialization in f2fs_recover_fsync_data() f2fs: revert summary entry count from 2048 to 512 in 16kb block support f2fs: fix to detect recoverable inode during dryrun of find_fsync_dnodes() f2fs: fix return value of f2fs_recover_fsync_data() f2fs: add fadvise tracepoint f2fs: fix age extent cache insertion skip on counter overflow f2fs: Add sanity checks before unlinking and loading inodes f2fs: Rename f2fs_unlink exit label f2fs: ensure minimum trim granularity accounts for all devices ...
2 parents cfd4039 + 76ee7fd commit cb01581

File tree

24 files changed

+643
-449
lines changed

24 files changed

+643
-449
lines changed

Documentation/ABI/testing/sysfs-fs-f2fs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,12 @@ Contact: "Jaegeuk Kim" <[email protected]>
643643
Description: Shows the number of unusable blocks in a section which was defined by
644644
the zone capacity reported by underlying zoned device.
645645

646+
What: /sys/fs/f2fs/<disk>/max_open_zones
647+
Date: November 2025
648+
Contact: "Yongpeng Yang" <[email protected]>
649+
Description: Shows the max number of zones that F2FS can write concurrently when a zoned
650+
device is mounted.
651+
646652
What: /sys/fs/f2fs/<disk>/current_atomic_write
647653
Date: July 2022
648654
Contact: "Daeho Jeong" <[email protected]>

Documentation/filesystems/f2fs.rst

Lines changed: 69 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -188,34 +188,36 @@ fault_type=%d Support configuring fault injection type, should be
188188
enabled with fault_injection option, fault type value
189189
is shown below, it supports single or combined type.
190190

191-
=========================== ==========
192-
Type_Name Type_Value
193-
=========================== ==========
194-
FAULT_KMALLOC 0x00000001
195-
FAULT_KVMALLOC 0x00000002
196-
FAULT_PAGE_ALLOC 0x00000004
197-
FAULT_PAGE_GET 0x00000008
198-
FAULT_ALLOC_BIO 0x00000010 (obsolete)
199-
FAULT_ALLOC_NID 0x00000020
200-
FAULT_ORPHAN 0x00000040
201-
FAULT_BLOCK 0x00000080
202-
FAULT_DIR_DEPTH 0x00000100
203-
FAULT_EVICT_INODE 0x00000200
204-
FAULT_TRUNCATE 0x00000400
205-
FAULT_READ_IO 0x00000800
206-
FAULT_CHECKPOINT 0x00001000
207-
FAULT_DISCARD 0x00002000
208-
FAULT_WRITE_IO 0x00004000
209-
FAULT_SLAB_ALLOC 0x00008000
210-
FAULT_DQUOT_INIT 0x00010000
211-
FAULT_LOCK_OP 0x00020000
212-
FAULT_BLKADDR_VALIDITY 0x00040000
213-
FAULT_BLKADDR_CONSISTENCE 0x00080000
214-
FAULT_NO_SEGMENT 0x00100000
215-
FAULT_INCONSISTENT_FOOTER 0x00200000
216-
FAULT_TIMEOUT 0x00400000 (1000ms)
217-
FAULT_VMALLOC 0x00800000
218-
=========================== ==========
191+
.. code-block:: none
192+
193+
=========================== ==========
194+
Type_Name Type_Value
195+
=========================== ==========
196+
FAULT_KMALLOC 0x00000001
197+
FAULT_KVMALLOC 0x00000002
198+
FAULT_PAGE_ALLOC 0x00000004
199+
FAULT_PAGE_GET 0x00000008
200+
FAULT_ALLOC_BIO 0x00000010 (obsolete)
201+
FAULT_ALLOC_NID 0x00000020
202+
FAULT_ORPHAN 0x00000040
203+
FAULT_BLOCK 0x00000080
204+
FAULT_DIR_DEPTH 0x00000100
205+
FAULT_EVICT_INODE 0x00000200
206+
FAULT_TRUNCATE 0x00000400
207+
FAULT_READ_IO 0x00000800
208+
FAULT_CHECKPOINT 0x00001000
209+
FAULT_DISCARD 0x00002000
210+
FAULT_WRITE_IO 0x00004000
211+
FAULT_SLAB_ALLOC 0x00008000
212+
FAULT_DQUOT_INIT 0x00010000
213+
FAULT_LOCK_OP 0x00020000
214+
FAULT_BLKADDR_VALIDITY 0x00040000
215+
FAULT_BLKADDR_CONSISTENCE 0x00080000
216+
FAULT_NO_SEGMENT 0x00100000
217+
FAULT_INCONSISTENT_FOOTER 0x00200000
218+
FAULT_TIMEOUT 0x00400000 (1000ms)
219+
FAULT_VMALLOC 0x00800000
220+
=========================== ==========
219221
mode=%s Control block allocation mode which supports "adaptive"
220222
and "lfs". In "lfs" mode, there should be no random
221223
writes towards main area.
@@ -296,14 +298,15 @@ nocheckpoint_merge Disable checkpoint merge feature.
296298
compress_algorithm=%s Control compress algorithm, currently f2fs supports "lzo",
297299
"lz4", "zstd" and "lzo-rle" algorithm.
298300
compress_algorithm=%s:%d Control compress algorithm and its compress level, now, only
299-
"lz4" and "zstd" support compress level config.
300-
301-
========= ===========
302-
algorithm level range
303-
========= ===========
304-
lz4 3 - 16
305-
zstd 1 - 22
306-
========= ===========
301+
"lz4" and "zstd" support compress level config::
302+
303+
========= ===========
304+
algorithm level range
305+
========= ===========
306+
lz4 3 - 16
307+
zstd 1 - 22
308+
========= ===========
309+
307310
compress_log_size=%u Support configuring compress cluster size. The size will
308311
be 4KB * (1 << %u). The default and minimum sizes are 16KB.
309312
compress_extension=%s Support adding specified extension, so that f2fs can enable
@@ -368,38 +371,42 @@ errors=%s Specify f2fs behavior on critical errors. This supports modes:
368371
the partition in read-only mode. By default it uses "continue"
369372
mode.
370373

371-
====================== =============== =============== ========
372-
mode continue remount-ro panic
373-
====================== =============== =============== ========
374-
access ops normal normal N/A
375-
syscall errors -EIO -EROFS N/A
376-
mount option rw ro N/A
377-
pending dir write keep keep N/A
378-
pending non-dir write drop keep N/A
379-
pending node write drop keep N/A
380-
pending meta write keep keep N/A
381-
====================== =============== =============== ========
374+
.. code-block:: none
375+
376+
====================== =============== =============== ========
377+
mode continue remount-ro panic
378+
====================== =============== =============== ========
379+
access ops normal normal N/A
380+
syscall errors -EIO -EROFS N/A
381+
mount option rw ro N/A
382+
pending dir write keep keep N/A
383+
pending non-dir write drop keep N/A
384+
pending node write drop keep N/A
385+
pending meta write keep keep N/A
386+
====================== =============== =============== ========
382387
nat_bits Enable nat_bits feature to enhance full/empty nat blocks access,
383388
by default it's disabled.
384389
lookup_mode=%s Control the directory lookup behavior for casefolded
385390
directories. This option has no effect on directories
386391
that do not have the casefold feature enabled.
387392

388-
================== ========================================
389-
Value Description
390-
================== ========================================
391-
perf (Default) Enforces a hash-only lookup.
392-
The linear search fallback is always
393-
disabled, ignoring the on-disk flag.
394-
compat Enables the linear search fallback for
395-
compatibility with directory entries
396-
created by older kernel that used a
397-
different case-folding algorithm.
398-
This mode ignores the on-disk flag.
399-
auto F2FS determines the mode based on the
400-
on-disk `SB_ENC_NO_COMPAT_FALLBACK_FL`
401-
flag.
402-
================== ========================================
393+
.. code-block:: none
394+
395+
================== ========================================
396+
Value Description
397+
================== ========================================
398+
perf (Default) Enforces a hash-only lookup.
399+
The linear search fallback is always
400+
disabled, ignoring the on-disk flag.
401+
compat Enables the linear search fallback for
402+
compatibility with directory entries
403+
created by older kernel that used a
404+
different case-folding algorithm.
405+
This mode ignores the on-disk flag.
406+
auto F2FS determines the mode based on the
407+
on-disk `SB_ENC_NO_COMPAT_FALLBACK_FL`
408+
flag.
409+
================== ========================================
403410
======================== ============================================================
404411

405412
Debugfs Entries

fs/f2fs/checkpoint.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ void f2fs_wait_on_all_pages(struct f2fs_sb_info *sbi, int type)
13181318
f2fs_submit_merged_write(sbi, DATA);
13191319

13201320
prepare_to_wait(&sbi->cp_wait, &wait, TASK_UNINTERRUPTIBLE);
1321-
io_schedule_timeout(DEFAULT_IO_TIMEOUT);
1321+
io_schedule_timeout(DEFAULT_SCHEDULE_TIMEOUT);
13221322
}
13231323
finish_wait(&sbi->cp_wait, &wait);
13241324
}
@@ -1673,15 +1673,15 @@ int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
16731673
goto out;
16741674
}
16751675

1676-
trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "start block_ops");
1676+
trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, CP_PHASE_START_BLOCK_OPS);
16771677

16781678
err = block_operations(sbi);
16791679
if (err)
16801680
goto out;
16811681

16821682
stat_cp_time(cpc, CP_TIME_OP_LOCK);
16831683

1684-
trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "finish block_ops");
1684+
trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, CP_PHASE_FINISH_BLOCK_OPS);
16851685

16861686
f2fs_flush_merged_writes(sbi);
16871687

@@ -1747,7 +1747,7 @@ int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
17471747

17481748
/* update CP_TIME to trigger checkpoint periodically */
17491749
f2fs_update_time(sbi, CP_TIME);
1750-
trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "finish checkpoint");
1750+
trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, CP_PHASE_FINISH_CHECKPOINT);
17511751
out:
17521752
if (cpc->reason != CP_RESIZE)
17531753
f2fs_up_write(&sbi->cp_global_sem);
@@ -1974,7 +1974,7 @@ void f2fs_flush_ckpt_thread(struct f2fs_sb_info *sbi)
19741974

19751975
/* Let's wait for the previous dispatched checkpoint. */
19761976
while (atomic_read(&cprc->queued_ckpt))
1977-
io_schedule_timeout(DEFAULT_IO_TIMEOUT);
1977+
io_schedule_timeout(DEFAULT_SCHEDULE_TIMEOUT);
19781978
}
19791979

19801980
void f2fs_init_ckpt_req_control(struct f2fs_sb_info *sbi)

fs/f2fs/compress.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static void f2fs_unlock_rpages(struct compress_ctx *cc, int len)
120120
}
121121

122122
static void f2fs_put_rpages_wbc(struct compress_ctx *cc,
123-
struct writeback_control *wbc, bool redirty, int unlock)
123+
struct writeback_control *wbc, bool redirty, bool unlock)
124124
{
125125
unsigned int i;
126126

@@ -759,10 +759,7 @@ void f2fs_decompress_cluster(struct decompress_io_ctx *dic, bool in_task)
759759
ret = -EFSCORRUPTED;
760760

761761
/* Avoid f2fs_commit_super in irq context */
762-
if (!in_task)
763-
f2fs_handle_error_async(sbi, ERROR_FAIL_DECOMPRESSION);
764-
else
765-
f2fs_handle_error(sbi, ERROR_FAIL_DECOMPRESSION);
762+
f2fs_handle_error(sbi, ERROR_FAIL_DECOMPRESSION);
766763
goto out_release;
767764
}
768765

@@ -1060,7 +1057,7 @@ static void cancel_cluster_writeback(struct compress_ctx *cc,
10601057
f2fs_submit_merged_write(F2FS_I_SB(cc->inode), DATA);
10611058
while (atomic_read(&cic->pending_pages) !=
10621059
(cc->valid_nr_cpages - submitted + 1))
1063-
f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT);
1060+
f2fs_io_schedule_timeout(DEFAULT_SCHEDULE_TIMEOUT);
10641061
}
10651062

10661063
/* Cancel writeback and stay locked. */
@@ -1205,7 +1202,7 @@ bool f2fs_compress_write_end(struct inode *inode, void *fsdata,
12051202
if (copied)
12061203
set_cluster_dirty(&cc);
12071204

1208-
f2fs_put_rpages_wbc(&cc, NULL, false, 1);
1205+
f2fs_put_rpages_wbc(&cc, NULL, false, true);
12091206
f2fs_destroy_compress_ctx(&cc, false);
12101207

12111208
return first_index;
@@ -1577,7 +1574,7 @@ static int f2fs_write_raw_pages(struct compress_ctx *cc,
15771574
*/
15781575
if (IS_NOQUOTA(cc->inode))
15791576
goto out;
1580-
f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT);
1577+
f2fs_schedule_timeout(DEFAULT_SCHEDULE_TIMEOUT);
15811578
goto retry_write;
15821579
}
15831580
goto out;
@@ -1608,7 +1605,7 @@ int f2fs_write_multi_pages(struct compress_ctx *cc,
16081605
add_compr_block_stat(cc->inode, cc->cluster_size);
16091606
goto write;
16101607
} else if (err) {
1611-
f2fs_put_rpages_wbc(cc, wbc, true, 1);
1608+
f2fs_put_rpages_wbc(cc, wbc, true, true);
16121609
goto destroy_out;
16131610
}
16141611

@@ -1622,7 +1619,7 @@ int f2fs_write_multi_pages(struct compress_ctx *cc,
16221619
f2fs_bug_on(F2FS_I_SB(cc->inode), *submitted);
16231620

16241621
err = f2fs_write_raw_pages(cc, submitted, wbc, io_type);
1625-
f2fs_put_rpages_wbc(cc, wbc, false, 0);
1622+
f2fs_put_rpages_wbc(cc, wbc, false, false);
16261623
destroy_out:
16271624
f2fs_destroy_compress_ctx(cc, false);
16281625
return err;

0 commit comments

Comments
 (0)