LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v2] f2fs: turn back remapped address in compressed page endio
@ 2021-07-28 19:38 Daeho Jeong
  2021-07-29  1:24 ` [f2fs-dev] " Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Daeho Jeong @ 2021-07-28 19:38 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel, kernel-team
  Cc: Daeho Jeong, Youngjin Gil, Hyeong Jun Kim

From: Daeho Jeong <daehojeong@google.com>

Turned back the remmaped sector address to the address in the partition,
when ending io, for compress cache to work properly.

Fixes: 6ce19aff0b8c ("f2fs: compress: add compress_inode to cache
compressed blocks")
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Youngjin Gil <youngjin.gil@samsung.com>
Signed-off-by: Hyeong Jun Kim <hj514.kim@samsung.com>

---
v2: avoid knowing too much about lower structures
---
 fs/f2fs/data.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 1a716c3b5457..0ec5950949fb 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -116,6 +116,7 @@ struct bio_post_read_ctx {
 	struct f2fs_sb_info *sbi;
 	struct work_struct work;
 	unsigned int enabled_steps;
+	block_t fs_blkaddr;
 };
 
 static void f2fs_finish_read_bio(struct bio *bio)
@@ -228,7 +229,7 @@ static void f2fs_handle_step_decompress(struct bio_post_read_ctx *ctx)
 	struct bio_vec *bv;
 	struct bvec_iter_all iter_all;
 	bool all_compressed = true;
-	block_t blkaddr = SECTOR_TO_BLOCK(ctx->bio->bi_iter.bi_sector);
+	block_t blkaddr = ctx->fs_blkaddr;
 
 	bio_for_each_segment_all(bv, ctx->bio, iter_all) {
 		struct page *page = bv->bv_page;
@@ -1003,6 +1004,7 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr,
 		ctx->bio = bio;
 		ctx->sbi = sbi;
 		ctx->enabled_steps = post_read_steps;
+		ctx->fs_blkaddr = blkaddr;
 		bio->bi_private = ctx;
 	}
 
-- 
2.32.0.432.gabb21c7263-goog


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

* Re: [f2fs-dev] [PATCH v2] f2fs: turn back remapped address in compressed page endio
  2021-07-28 19:38 [PATCH v2] f2fs: turn back remapped address in compressed page endio Daeho Jeong
@ 2021-07-29  1:24 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2021-07-29  1:24 UTC (permalink / raw)
  To: Daeho Jeong, linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong

On 2021/7/29 3:38, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
> 
> Turned back the remmaped sector address to the address in the partition,
> when ending io, for compress cache to work properly.
> 
> Fixes: 6ce19aff0b8c ("f2fs: compress: add compress_inode to cache
> compressed blocks")
> Signed-off-by: Daeho Jeong <daehojeong@google.com>
> Signed-off-by: Youngjin Gil <youngjin.gil@samsung.com>
> Signed-off-by: Hyeong Jun Kim <hj514.kim@samsung.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

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

end of thread, other threads:[~2021-07-29  1:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-28 19:38 [PATCH v2] f2fs: turn back remapped address in compressed page endio Daeho Jeong
2021-07-29  1:24 ` [f2fs-dev] " Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).