From: Daeho Jeong <daeho43@gmail.com>
To: linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com
Cc: Daeho Jeong <daehojeong@google.com>
Subject: [f2fs-dev] [PATCH 09/20] f2fs: support subpage blocks in pinned files
Date: Mon, 2 Nov 2026 11:39:41 -0800 [thread overview]
Message-ID: <20261102193952.3002018-10-daeho43@gmail.com> (raw)
In-Reply-To: <20261102193952.3002018-1-daeho43@gmail.com>
From: Daeho Jeong <daehojeong@google.com>
Pinned files must not allocate blocks outside fallocate(). As write()
does, return -EIO from page_mkwrite when the folio range up to EOF is
not fully allocated, and remove the -EOPNOTSUPP checks.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
---
fs/f2fs/file.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index e68553cef777..36da0d558ef0 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -240,6 +240,13 @@ static vm_fault_t f2fs_vm_page_mkwrite(struct vm_fault *vmf)
nr = DIV_ROUND_UP(dirty_len, PAGE_SIZE);
if (f2fs_has_subpage_blocks(sbi)) {
+ if (f2fs_is_pinned_file(inode) &&
+ !f2fs_overwrite_io(inode, folio_pos(folio), dirty_len)) {
+ folio_unlock(folio);
+ err = -EIO;
+ goto out_sem;
+ }
+
/*
* A writable PTE covers the whole base folio. Like ext4's
* block_page_mkwrite(), prepare every filesystem block through EOF
@@ -2280,8 +2287,7 @@ static long f2fs_fallocate(struct file *file, int mode,
if (f2fs_has_subpage_blocks(F2FS_I_SB(inode))) {
if ((mode & (FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_INSERT_RANGE)) ||
- f2fs_is_pinned_file(inode) || f2fs_is_atomic_file(inode) ||
- f2fs_compressed_file(inode)) {
+ f2fs_is_atomic_file(inode) || f2fs_compressed_file(inode)) {
ret = -EOPNOTSUPP;
goto out;
}
@@ -3823,9 +3829,6 @@ static int f2fs_ioc_set_pin_file(struct file *filp, unsigned long arg)
__u32 pin;
int ret = 0;
- if (f2fs_has_subpage_blocks(sbi))
- return -EOPNOTSUPP;
-
if (get_user(pin, (__u32 __user *)arg))
return -EFAULT;
--
2.56.0.317.g454f8302e1-goog
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Daeho Jeong <daeho43@gmail.com>
To: linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com
Cc: Daeho Jeong <daehojeong@google.com>
Subject: [PATCH 09/20] f2fs: support subpage blocks in pinned files
Date: Mon, 2 Nov 2026 11:39:41 -0800 [thread overview]
Message-ID: <20261102193952.3002018-10-daeho43@gmail.com> (raw)
In-Reply-To: <20261102193952.3002018-1-daeho43@gmail.com>
From: Daeho Jeong <daehojeong@google.com>
Pinned files must not allocate blocks outside fallocate(). As write()
does, return -EIO from page_mkwrite when the folio range up to EOF is
not fully allocated, and remove the -EOPNOTSUPP checks.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
---
fs/f2fs/file.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index e68553cef777..36da0d558ef0 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -240,6 +240,13 @@ static vm_fault_t f2fs_vm_page_mkwrite(struct vm_fault *vmf)
nr = DIV_ROUND_UP(dirty_len, PAGE_SIZE);
if (f2fs_has_subpage_blocks(sbi)) {
+ if (f2fs_is_pinned_file(inode) &&
+ !f2fs_overwrite_io(inode, folio_pos(folio), dirty_len)) {
+ folio_unlock(folio);
+ err = -EIO;
+ goto out_sem;
+ }
+
/*
* A writable PTE covers the whole base folio. Like ext4's
* block_page_mkwrite(), prepare every filesystem block through EOF
@@ -2280,8 +2287,7 @@ static long f2fs_fallocate(struct file *file, int mode,
if (f2fs_has_subpage_blocks(F2FS_I_SB(inode))) {
if ((mode & (FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_INSERT_RANGE)) ||
- f2fs_is_pinned_file(inode) || f2fs_is_atomic_file(inode) ||
- f2fs_compressed_file(inode)) {
+ f2fs_is_atomic_file(inode) || f2fs_compressed_file(inode)) {
ret = -EOPNOTSUPP;
goto out;
}
@@ -3823,9 +3829,6 @@ static int f2fs_ioc_set_pin_file(struct file *filp, unsigned long arg)
__u32 pin;
int ret = 0;
- if (f2fs_has_subpage_blocks(sbi))
- return -EOPNOTSUPP;
-
if (get_user(pin, (__u32 __user *)arg))
return -EFAULT;
--
2.56.0.317.g454f8302e1-goog
next prev parent reply other threads:[~2026-11-02 19:40 UTC|newest]
Thread overview: 92+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 19:39 [f2fs-dev] [PATCH 00/20] f2fs: support block size smaller than PAGE_SIZE Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-02 19:39 ` [f2fs-dev] [PATCH 01/20] f2fs: use block-based index and size calculations in remaining paths Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-03 7:04 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-11-03 7:04 ` Chao Yu
2026-11-02 19:39 ` [f2fs-dev] [PATCH 02/20] f2fs: support subpage block size superblock and mount Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-03 9:26 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-11-03 9:26 ` Chao Yu
2026-11-02 19:39 ` [f2fs-dev] [PATCH 03/20] f2fs: extend f2fs_folio_state for subpage blocks Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-04 9:19 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-11-04 9:19 ` Chao Yu
2026-11-06 20:53 ` Daeho Jeong
2026-11-06 20:53 ` Daeho Jeong
2026-11-11 10:39 ` Nanzhe Zhao
2026-11-11 10:39 ` Nanzhe Zhao
2026-11-11 21:27 ` Daeho Jeong
2026-11-11 21:27 ` Daeho Jeong
2026-11-02 19:39 ` [f2fs-dev] [PATCH 04/20] f2fs: support subpage blocks in directory operations Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-04 11:13 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-11-04 11:13 ` Chao Yu
2026-11-02 19:39 ` [f2fs-dev] [PATCH 05/20] f2fs: convert inode dirty page counters to dirty block counters Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-04 11:24 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-11-04 11:24 ` Chao Yu
2026-11-06 21:29 ` Daeho Jeong
2026-11-06 21:29 ` Daeho Jeong
2026-11-02 19:39 ` [f2fs-dev] [PATCH 06/20] f2fs: support subpage blocks in data read path and GC Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-05 7:55 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-11-05 7:55 ` Chao Yu
2026-11-02 19:39 ` [f2fs-dev] [PATCH 07/20] f2fs: support subpage blocks in data write path and writeback Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-06 2:52 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-11-06 2:52 ` Chao Yu
2026-11-07 23:14 ` Daeho Jeong
2026-11-07 23:14 ` Daeho Jeong
2026-11-10 11:19 ` Chao Yu
2026-11-10 11:19 ` Chao Yu via Linux-f2fs-devel
2026-11-10 19:50 ` Daeho Jeong
2026-11-10 19:50 ` Daeho Jeong
2026-11-11 6:40 ` Chao Yu
2026-11-11 6:40 ` Chao Yu via Linux-f2fs-devel
2026-11-02 19:39 ` [f2fs-dev] [PATCH 08/20] f2fs: adapt range operations and mmap for subpage blocks Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-06 3:54 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-11-06 3:54 ` Chao Yu
2026-11-07 23:24 ` Daeho Jeong
2026-11-07 23:24 ` Daeho Jeong
2026-11-10 11:35 ` Chao Yu via Linux-f2fs-devel
2026-11-10 11:35 ` Chao Yu
2026-11-02 19:39 ` Daeho Jeong [this message]
2026-11-02 19:39 ` [PATCH 09/20] f2fs: support subpage blocks in pinned files Daeho Jeong
2026-11-02 19:39 ` [f2fs-dev] [PATCH 10/20] f2fs: support subpage blocks in collapse and insert range Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-02 19:39 ` [f2fs-dev] [PATCH 11/20] f2fs: support subpage blocks in move range Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-02 19:39 ` [f2fs-dev] [PATCH 12/20] f2fs: support subpage blocks in defragmentation Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-02 19:39 ` [f2fs-dev] [PATCH 13/20] f2fs: support subpage blocks in swapfile activation Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-02 19:39 ` [f2fs-dev] [PATCH 14/20] f2fs: support subpage blocks in fs-verity enablement Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-02 19:39 ` [f2fs-dev] [PATCH 15/20] f2fs: support subpage blocks in atomic writes Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-09 2:56 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-11-09 2:56 ` Chao Yu
2026-11-10 11:49 ` Chao Yu
2026-11-10 11:49 ` Chao Yu via Linux-f2fs-devel
2026-11-10 21:28 ` Daeho Jeong
2026-11-10 21:28 ` Daeho Jeong
2026-11-02 19:39 ` [f2fs-dev] [PATCH 16/20] f2fs: preserve inline data in subpage block mode Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-09 3:18 ` [f2fs-dev] " Chao Yu
2026-11-09 3:18 ` Chao Yu via Linux-f2fs-devel
2026-11-02 19:39 ` [f2fs-dev] [PATCH 17/20] f2fs: support subpage blocks in online resize Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-02 19:39 ` [f2fs-dev] [PATCH 18/20] f2fs: support subpage blocks in compression Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-10 3:04 ` [f2fs-dev] " Chao Yu
2026-11-10 3:04 ` Chao Yu via Linux-f2fs-devel
2026-11-10 18:45 ` Daeho Jeong
2026-11-10 18:45 ` Daeho Jeong
2026-11-11 2:07 ` Chao Yu
2026-11-11 2:07 ` Chao Yu via Linux-f2fs-devel
2026-11-02 19:39 ` [f2fs-dev] [PATCH 19/20] f2fs: count compress cache entries in pages for its memory limit Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
2026-11-02 19:39 ` [f2fs-dev] [PATCH 20/20] f2fs: enable subpage block size support Daeho Jeong
2026-11-02 19:39 ` Daeho Jeong
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=20261102193952.3002018-10-daeho43@gmail.com \
--to=daeho43@gmail.com \
--cc=daehojeong@google.com \
--cc=kernel-team@android.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.