Skip to contentSkip to conversation

f2fs: turn back remapped address in compressed page endio

PATCH In review Daeho Jeong 2 participants 2 messages Jul 28, 2021 – Jul 29, 2021 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 f2fs: turn back remapped address in compressed page endio

From: Daeho Jeong <[email protected]>

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")

---
v2: avoid knowing too much about lower structures

---
 fs/f2fs/data.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/f2fs/data.c +3 -1
index 1a716c3b5457..0ec5950949fb 100644
@@ -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;
 	}
 
Signature · 1 line
2.32.0.432.gabb21c7263-goog
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines · Daeho Jeong

From: Daeho Jeong <[email protected]>

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")

Thanks,

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