when we overwrite the whole page in cluster, we don't need read original
data before write, because after write_end(), writepages() can help to
load left data in that cluster.

Signed-off-by: Fengnan Chang <[email protected]>
Signed-off-by: Chao Yu <[email protected]>
Acked-by: Chao Yu <[email protected]>
---
 fs/f2fs/data.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 3a01a1b50104..2aeb1196cd5f 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3328,6 +3328,9 @@ static int f2fs_write_begin(struct file *file, struct 
address_space *mapping,

                *fsdata = NULL;

+               if (len == PAGE_SIZE)
+                       goto repeat;
+
                ret = f2fs_prepare_compress_overwrite(inode, pagep,
                                                        index, fsdata);
                if (ret < 0) {
--
2.29.0



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

Reply via email to