All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: fix retry logic in f2fs_write_cache_pages()
@ 2020-05-27  2:20 ` Sahitya Tummala
  0 siblings, 0 replies; 14+ messages in thread
From: Sahitya Tummala @ 2020-05-27  2:20 UTC (permalink / raw)
  To: Jaegeuk Kim, Chao Yu, linux-f2fs-devel; +Cc: linux-kernel

In case a compressed file is getting overwritten, the current retry
logic doesn't include the current page to be retried now as it sets
the new start index as 0 and new end index as writeback_index - 1.
This causes the corresponding cluster to be uncompressed and written
as normal pages without compression. Fix this by allowing writeback to
be retried for the current page as well (in case of compressed page
getting retried due to index mismatch with cluster index). So that
this cluster can be written compressed in case of overwrite.

Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
 fs/f2fs/data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 4af5fcd..bfd1df4 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3024,7 +3024,7 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
 	if ((!cycled && !done) || retry) {
 		cycled = 1;
 		index = 0;
-		end = writeback_index - 1;
+		end = retry ? -1 : writeback_index - 1;
 		goto retry;
 	}
 	if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0))
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

end of thread, other threads:[~2020-06-01 11:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-27  2:20 [f2fs-dev] [PATCH] f2fs: fix retry logic in f2fs_write_cache_pages() Sahitya Tummala
2020-05-27  2:20 ` Sahitya Tummala
2020-05-28  2:45 ` [f2fs-dev] " Chao Yu
2020-05-28  2:45   ` Chao Yu
2020-05-28  2:55   ` [f2fs-dev] " Chao Yu
2020-05-28  2:55     ` Chao Yu
2020-05-28 19:18     ` Jaegeuk Kim
2020-05-28 19:18       ` Jaegeuk Kim
2020-06-01  9:15       ` Sahitya Tummala
2020-06-01  9:15         ` Sahitya Tummala
2020-06-01  9:20       ` Sahitya Tummala
2020-06-01  9:20         ` Sahitya Tummala
2020-06-01 11:43         ` Chao Yu
2020-06-01 11:43           ` Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.