Skip to contentSkip to conversation

f2fs: allow F2FS_IPU_NOCACHE for pinned file

PATCH Applied Jaegeuk Kim 4 participants 4 messages Sep 15, 2024 – Sep 19, 2024 F2FS file system

lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 f2fs: allow F2FS_IPU_NOCACHE for pinned file

This patch allows f2fs to submit bios of in-place writes on pinned file.

---
 fs/f2fs/sysfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/sysfs.c +2 -1
index d18931b7b094..c56e8c873935 100644
@@ -792,7 +792,8 @@ static ssize_t __sbi_store(struct f2fs_attr *a,
 	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;
Signature · 1 line
2.46.0.662.g92d0881bb0-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 23 lines · On Sat, Sep 14, 2024 at 8:24 PM Jaegeuk Kim via Linux-f2fs-devel…

This patch allows f2fs to submit bios of in-place writes on pinned file.

---
 fs/f2fs/sysfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/sysfs.c +2 -2
index d18931b7b094..c56e8c873935 100644
@@ -792,7 +792,8 @@ static ssize_t __sbi_store(struct f2fs_attr *a,
        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;
--
Quoted 2 lines

2.46.0.662.g92d0881bb0-goog

Thanks,

Quoted 6 lines

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#2 lore raw
In reply to Jaegeuk Kim
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 6 lines · On Sun, 15 Sep 2024 03:22:51 +0000 you wrote:

This patch allows f2fs to submit bios of in-place writes on pinned file.

---
 fs/f2fs/sysfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Here is the summary with links:
- [f2fs-dev] f2fs: allow F2FS_IPU_NOCACHE for pinned file

    https://git.kernel.org/jaegeuk/f2fs/c/755f18261376

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html