mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
erofs: ensure that the post-EOF tails are all zeroed
commite4c1cf523d
upstream. This was accidentally fixed up in commite4c1cf523d
but we can't take the full change due to other dependancy issues, so here is just the actual bugfix that is needed. [Background] keltargw reported an issue [1] that with mmaped I/Os, sometimes the tail of the last page (after file ends) is not filled with zeroes. The root cause is that such tail page could be wrongly selected for inplace I/Os so the zeroed part will then be filled with compressed data instead of zeroes. A simple fix is to avoid doing inplace I/Os for such tail parts, actually that was already fixed upstream in commite4c1cf523d
("erofs: tidy up z_erofs_do_read_page()") by accident. [1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com Reported-by: keltargw <keltar.gw@gmail.com> Fixes:3883a79abd
("staging: erofs: introduce VLE decompression support") Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c2cbfe5f51
commit
1ce9ebc96e
1 changed files with 2 additions and 0 deletions
|
@ -869,6 +869,8 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
|
|||
cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
|
||||
if (!(map->m_flags & EROFS_MAP_MAPPED)) {
|
||||
zero_user_segment(page, cur, end);
|
||||
++spiltted;
|
||||
tight = false;
|
||||
goto next_part;
|
||||
}
|
||||
if (map->m_flags & EROFS_MAP_FRAGMENT) {
|
||||
|
|
Loading…
Reference in a new issue