From: Jaegeuk Kim Date: Sat, 14 Sep 2024 21:44:10 +0000 (+0000) Subject: f2fs: allow F2FS_IPU_NOCACHE for pinned file X-Git-Tag: v6.12-rc1~59^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ae87b9c2dc9800e6ab52febd09341140599ff8e3;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index d18931b7b0945..c56e8c8739352 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;