Skip to content
Commit e6d9f9ba authored by Jingbo Xu's avatar Jingbo Xu Committed by Gao Xiang
Browse files

erofs: get correct count for unmapped range in fscache mode

For unmapped range, the returned map.m_llen is zero, and thus the
calculated count is unexpected zero.

Prior to the refactoring introduced by commit 1ae9470c ("erofs:
clean up .read_folio() and .readahead() in fscache mode"), only the
readahead routine suffers from this. With the refactoring of making
.read_folio() and .readahead() calling one common routine, both
read_folio and readahead have this issue now.

Fix this by calculating count separately in unmapped condition.

Fixes: c665b394 ("erofs: implement fscache-based data readahead")
Fixes: 1ae9470c

 ("erofs: clean up .read_folio() and .readahead() in fscache mode")
Signed-off-by: default avatarJingbo Xu <jefflexu@linux.alibaba.com>
Reviewed-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Link: https://lore.kernel.org/r/20221104054028.52208-3-jefflexu@linux.alibaba.com
Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
parent 75e43355
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment