Linux Documentation
 help / color / mirror / Atom feed
* [PATCH 0/2] f2fs: multi-device expandable storage support
@ 2026-08-28 12:18 李珂11
  2026-08-28 12:18 ` [PATCH 1/2] f2fs: add alloc_primary mount option 李珂11
  2026-08-28 12:18 ` [PATCH 2/2] f2fs: allow f2fs_resize_fs to drop the last secondary device 李珂11
  0 siblings, 2 replies; 3+ messages in thread
From: 李珂11 @ 2026-08-28 12:18 UTC (permalink / raw)
  To: linux-f2fs-devel@lists.sourceforge.net
  Cc: jaegeuk@kernel.org, chao@kernel.org, linux-doc@vger.kernel.org,
	李珂11

From: "ke.li11" <ke.li11@transsion.com>

This series improves multi-device F2FS for expandable storage setups
where a secondary block device holds warm/cold data and may be removed
after userspace performs a final shrink.

Patch 1 adds an alloc_primary mount option.  By default F2FS steers
warm/cold allocations to the secondary device via ALLOC_NEXT; this
option keeps them on the primary device when required by userspace
volume management.

Patch 2 extends f2fs_resize_fs() to allow a section-aligned shrink
that fully removes the last secondary device.  The on-disk superblock
path for that device is cleared before commit so the next mount does
not try to open a block device that userspace is deleting.  The
in-memory device is detached only after both the superblock update and
checkpoint succeed; the path is restored if either step fails.

Testing:
- Mounted /data as a multi-device F2FS filesystem with a secondary expand
  device (device=exp_user_device)
- Exercised dynamic resize while the expand volume is attached
- Shrunk the filesystem until the entire exp_user_device is removed;
  this triggers the drop_last_dev path in f2fs_resize_fs()
- Verified remount succeeds after userspace tears down the expand
  block device
- Mounted with and without alloc_primary and verified allocation behavior

Signed-off-by: ke.li11 <ke.li11@transsion.com>

ke.li11 (2):
  f2fs: add alloc_primary mount option
  f2fs: allow f2fs_resize_fs to drop the last secondary device

 Documentation/filesystems/f2fs.rst |   3 +
 fs/f2fs/f2fs.h                     |   6 ++
 fs/f2fs/gc.c                       | 127 +++++++++++++++++++++++++++--
 fs/f2fs/super.c                    |  12 +++
 4 files changed, 143 insertions(+), 5 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-28 12:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28 12:18 [PATCH 0/2] f2fs: multi-device expandable storage support 李珂11
2026-08-28 12:18 ` [PATCH 1/2] f2fs: add alloc_primary mount option 李珂11
2026-08-28 12:18 ` [PATCH 2/2] f2fs: allow f2fs_resize_fs to drop the last secondary device 李珂11

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox