Skip to content
Commit 1ce9ebc9 authored by Gao Xiang's avatar Gao Xiang Committed by Greg Kroah-Hartman
Browse files

erofs: ensure that the post-EOF tails are all zeroed

commit e4c1cf52 upstream.

This was accidentally fixed up in commit e4c1cf52 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 commit e4c1cf52
("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: default avatarkeltargw <keltar.gw@gmail.com>
Fixes: 3883a79a

 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c2cbfe5f
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