From: 李珂11 <ke.li11@transsion.com>
To: "linux-f2fs-devel@lists.sourceforge.net"
<linux-f2fs-devel@lists.sourceforge.net>
Cc: "jaegeuk@kernel.org" <jaegeuk@kernel.org>,
"chao@kernel.org" <chao@kernel.org>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
李珂11 <ke.li11@transsion.com>
Subject: [PATCH 0/2] f2fs: multi-device expandable storage support
Date: Fri, 28 Aug 2026 12:18:34 +0000 [thread overview]
Message-ID: <20260828121816.1463654-1-ke.li11@transsion.com> (raw)
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
next reply other threads:[~2026-08-28 12:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 12:18 李珂11 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260828121816.1463654-1-ke.li11@transsion.com \
--to=ke.li11@transsion.com \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox