summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2024-09-14 21:44:10 +0000
committerJaegeuk Kim <jaegeuk@kernel.org>2024-09-23 15:42:13 +0000
commitae87b9c2dc9800e6ab52febd09341140599ff8e3 (patch)
treedf23cb8ec036fb57e87a4995852a4d117f7a0bdb
parent5cc69a27abfa91abbb39fc584f82d6c867b60f47 (diff)
f2fs: allow F2FS_IPU_NOCACHE for pinned file
This patch allows f2fs to submit bios of in-place writes on pinned file. Reviewed-by: Daeho Jeong <daehojeong@google.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/sysfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
index d18931b7b094..c56e8c873935 100644
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -792,7 +792,8 @@ out:
if (!strcmp(a->attr.name, "ipu_policy")) {
if (t >= BIT(F2FS_IPU_MAX))
return -EINVAL;
- if (t && f2fs_lfs_mode(sbi))
+ /* allow F2FS_IPU_NOCACHE only for IPU in the pinned file */
+ if (f2fs_lfs_mode(sbi) && (t & ~BIT(F2FS_IPU_NOCACHE)))
return -EINVAL;
SM_I(sbi)->ipu_policy = (unsigned int)t;
return count;