Skip to contentSkip to conversation

f2fs: turn back remapped address in compressed page endio

PATCH Superseded Daeho Jeong 1 participant 1 message Jul 27, 2021 F2FS file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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

---
 fs/f2fs/data.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
fs/f2fs/data.c +7 -1
index 1a716c3b5457..53e71e1bb673 100644
@@ -228,7 +228,13 @@ 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);
+	sector_t sector = ctx->bio->bi_iter.bi_sector;
+	block_t blkaddr;
+
+	if (bio_flagged(ctx->bio, BIO_REMAPPED))
+		sector -= ctx->bio->bi_bdev->bd_start_sect;
+
+	blkaddr = SECTOR_TO_BLOCK(sector);
 
 	bio_for_each_segment_all(bv, ctx->bio, iter_all) {
 		struct page *page = bv->bv_page;
Signature · 8 lines
2.32.0.432.gabb21c7263-goog



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