summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-08-28 10:48:48 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-08-28 10:48:48 -0700
commit115bd364ab20b2dbef22824ec80d15901847dbe2 (patch)
treedc4e57a6e9047e8efc745b9b737363015ae49099 /Documentation
parentc20313e98b04ce543936431b6122dd639d3a8346 (diff)
parentc966d29e01bbf829f8bb4a39a49811c56cdb49c3 (diff)
downloadlinux-115bd364ab20b2dbef22824ec80d15901847dbe2.tar.gz
linux-115bd364ab20b2dbef22824ec80d15901847dbe2.zip
Merge tag 'f2fs-for-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs
Pull f2fs updates from Jaegeuk Kim: "In this round, key enhancements focus on reducing inode management memory overhead, introducing resizable tail sections with unified pinned allocation, and boosting I/O throughput via parallel multi-device flushes and asynchronous f2fs_write_end_io() execution. We also add dynamic device alias reservations to allow on-the-fly space donation from user partitions. Alongside these features, critical bug fixes resolve folio race conditions, lingering dirty flags, dentry and block counter leaks, and potential deadloops in f2fs_fsync_node_pages(). Additional stability patches address error-path handling across symlink, sync, and rename/unlink operations, prevent pinned file fragmentation, and correct segment migration and free section accounting in free_segment_range. Enhancements: - reduce memory footprint of ino management - support dynamic reserve/release for device aliasing - issue multi-device flushes in parallel - add a way to run f2fs_write_end_io() asynchronously - support resizable tail section and unify pinned allocation Bug fixes: - fix to pass folio->index to f2fs_sanity_check_node_footer() - fix folio_nr_pages() race after put in large folio invalidate - fix to clear dirty flag on folio in error path - accurately adjust free_sections during free_segment_range - fix to avoid potential deadloop in f2fs_fsync_node_pages() - fix the error path in symlink, device alias in rename/unlink, f2fs_sync_fs - fix to migrate all curseg types during free_segment_range - fix to avoid pinfile fragment on fragment:{block, segment} mode - fix valid block count leak on data block allocation failure - fix dentry folio leak in find_in_level - reject overlapping move range after len expansion - fix some bugs related to file pinning, GC functions, i_size And, the series includes a number of minor bug fixes" * tag 'f2fs-for-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (51 commits) f2fs: support resizable tail section and unify pinned allocation f2fs: don't leave the hashed inode while it's unlinked f2fs: accurately adjust free_sections during free_segment_range f2fs: fix to avoid potential deadloop in f2fs_fsync_node_pages() f2fs: use adjusted write range after f2fs_write_checks() f2fs: fix to propagate error from f2fs_sync_fs() f2fs: return symlink writeback errors f2fs: fix error handling on device alias check in rename and unlink f2fs: fix to reset all pinned status during fggc f2fs: use f2fs_{down, up}_(read, write}_trace() for nat_tree_lock f2fs: reduce memory footprint of ino management f2fs: fix i_size when pinned fallocate partially fails f2fs: fix to migrate all curseg types during free_segment_range f2fs: avoid setting SBI_NEED_FSCK on transient resize failure f2fs: fix to avoid pinfile fragment on fragment:{block, segment} mode f2fs: cleanup w/ f2fs_need_rand_{blk, seg, seg_blk} f2fs: fix to shrink gc_lock coverage in f2fs_gc_range() f2fs: fix to reclaim space in f2fs_allocate_pinning_section() f2fs: unify add/remove ino entry API for all ino types f2fs: fix to zero post-EOF data when extending file size ...
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/ABI/testing/sysfs-fs-f2fs18
-rw-r--r--Documentation/filesystems/f2fs.rst43
2 files changed, 60 insertions, 1 deletions
diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs
index 1b58c029abd0..0cebc89799dd 100644
--- a/Documentation/ABI/testing/sysfs-fs-f2fs
+++ b/Documentation/ABI/testing/sysfs-fs-f2fs
@@ -986,6 +986,7 @@ Description: This sysfs entry can be used to enable/disable to adjust priority f
0x00000008 gc_lock
0x00000010 cp_global
0x00000020 io_rwsem
+ 0x00000040 nat_tree_lock
========== ==================
What: /sys/fs/f2fs/<disk>/lock_duration_priority
@@ -1002,3 +1003,20 @@ Description: It can be used to tune priority of f2fs critical task, e.g. f2fs_ck
threads, limitation as below:
- it requires user has CAP_SYS_NICE capability.
- the range is [100, 139], by default the value is 120.
+
+What: /sys/fs/f2fs/<disk>/max_atc_write_bio_size
+Date: June 2026
+Contact: Bart Van Assche <bvanassche@acm.org>
+Description: Every time a write operation completes f2fs_write_end_io() is
+ called. This function may be called from an atomic context,
+ e.g. from inside an interrupt handler. This attribute controls
+ the maximum size of a write bio that is completed in atomic
+ (atc) context. The default value for this attribute is UINT_MAX
+ which means that this functionality is disabled by default.
+
+What: /sys/fs/f2fs/<disk>/pinned_area_max_secno
+Date: August 2026
+Contact: "Daeho Jeong" <daehojeong@google.com>
+Description: This is a read-only entry to show the upper bound section number
+ for pinned files. Pinned files will only be allocated within
+ sections 0 to pinned_area_max_secno - 1.
diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst
index b45d7a687625..771216f45207 100644
--- a/Documentation/filesystems/f2fs.rst
+++ b/Documentation/filesystems/f2fs.rst
@@ -415,7 +415,13 @@ lookup_mode=%s Control the directory lookup behavior for casefolded
auto F2FS determines the mode based on the
on-disk `SB_ENC_NO_COMPAT_FALLBACK_FL`
flag.
- ================== ========================================
+resizable_tail_secno=%u Control the number of sections at the tail of the
+ filesystem reserved for online resizing. Pinned files
+ will only be allocated within sections 0 to
+ (MAIN_SECS - resizable_tail_secno) - 1. If set to 0
+ (default), there is no tail restriction unless running
+ on a zoned block device where conventional zones are
+ used.
======================== ============================================================
Debugfs Entries
@@ -1043,6 +1049,41 @@ So, the key idea is, user can do any file operations on /dev/vdc, and
reclaim the space after the use, while the space is counted as /data.
That doesn't require modifying partition size and filesystem format.
+Dynamic Device Aliasing Management
+----------------------------------
+
+In addition to static device aliasing by deleting the aliasing file, F2FS
+supports dynamic management of device aliasing. This mechanism allows the system
+to dynamically transition partition ownership between F2FS userdata and external
+entities (e.g., zRAM, raw partition) based on system requirements without
+deleting the master aliasing file or requiring unmount/remount.
+
+The master aliasing file is created during the initial format of the file system
+and remains as a persistent control entity (ioctl gateway) in the root directory.
+
+- Partition Reservation (In-service to Aliased)
+ When a specific partition needs to be dedicated to external services (e.g., zRAM),
+ a user can reserve the device alias range via ioctl. The kernel resets GC victim
+ information for the target range, marks segments as in-use to prevent new
+ allocations, and triggers forced GC to migrate existing valid data out of the
+ range. Finally, it reserves these blocks in the SIT to effectively exclude the
+ device from the usable capacity.
+
+- Partition Release (Aliased to In-service)
+ When external usage concludes, the space is reclaimed not by deleting the file,
+ but through the release ioctl. The kernel truncates blocks associated with
+ the file, releasing them back to general filesystem allocation.
+
+.. code-block::
+
+ # f2fs_io dev_alias release /mnt/f2fs/vdc.file
+ # df -h
+ /dev/vdb 64G 753M 64G 2% /mnt/f2fs
+
+ # f2fs_io dev_alias reserve /mnt/f2fs/vdc.file
+ # df -h
+ /dev/vdb 64G 33G 32G 52% /mnt/f2fs
+
Per-file Read-Only Large Folio Support
--------------------------------------