public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] f2fs: prevent atomic write on pinned file
@ 2024-03-11 23:59 Daeho Jeong
  2024-03-11 23:59 ` [PATCH 2/2] f2fs: prevent writing without fallocate() for pinned files Daeho Jeong
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Daeho Jeong @ 2024-03-11 23:59 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong

From: Daeho Jeong <daehojeong@google.com>

Since atomic write way was changed to out-place-update, we should
prevent it on pinned files.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
---
 fs/f2fs/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 1c044fb19c87..82277e95c88f 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -2085,7 +2085,8 @@ static int f2fs_ioc_start_atomic_write(struct file *filp, bool truncate)
 
 	inode_lock(inode);
 
-	if (!f2fs_disable_compressed_file(inode)) {
+	if (!f2fs_disable_compressed_file(inode) ||
+			f2fs_is_pinned_file(inode)) {
 		ret = -EINVAL;
 		goto out;
 	}
-- 
2.44.0.278.ge034bb2e1d-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-13  1:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-11 23:59 [PATCH 1/2] f2fs: prevent atomic write on pinned file Daeho Jeong
2024-03-11 23:59 ` [PATCH 2/2] f2fs: prevent writing without fallocate() for pinned files Daeho Jeong
2024-03-12  1:50   ` [f2fs-dev] " Chao Yu
2024-03-12  1:43 ` [f2fs-dev] [PATCH 1/2] f2fs: prevent atomic write on pinned file Chao Yu
2024-03-13  1:30 ` patchwork-bot+f2fs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox