erofs: shouldn't churn the mapping page for duplicated copies
authorGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 12 Oct 2022 04:50:56 +0000 (12:50 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Sun, 16 Oct 2022 22:55:49 +0000 (06:55 +0800)
commit63bbb85658ea43dd35dbfde6d4150b47c407fc87
treef4aa82707c133c0dd5101eb2086ea57efae0e16f
parent664609e49f1c84fc97987b2bf64544e586b8849c
erofs: shouldn't churn the mapping page for duplicated copies

If other duplicated copies exist in one decompression shot, should
leave the old page as is rather than replace it with the new duplicated
one.  Otherwise, the following cold path to deal with duplicated copies
will use the invalid bvec.  It impacts compressed data deduplication.

Also, shift the onlinepage EIO bit to avoid touching the signed bit.

Fixes: 267f2492c8f7 ("erofs: introduce multi-reference pclusters (fully-referenced)")
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20221012045056.13421-1-hsiangkao@linux.alibaba.com
fs/erofs/zdata.c
fs/erofs/zdata.h