]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
f2fs: allow F2FS_IPU_NOCACHE for pinned file
authorJaegeuk Kim <jaegeuk@kernel.org>
Sat, 14 Sep 2024 21:44:10 +0000 (21:44 +0000)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 23 Sep 2024 15:42:13 +0000 (15:42 +0000)
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>
fs/f2fs/sysfs.c

index d18931b7b094554c4fd9fa472ec8c7e7de4154a9..c56e8c8739352337ecaedecba5c90e147c6a7f1e 100644 (file)
@@ -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;