linux-stable/fs/erofs
Gao Xiang e83f5d13cb erofs: ensure that the post-EOF tails are all zeroed
commit e4c1cf523d upstream.

This was accidentally fixed up in commit e4c1cf523d 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 e4c1cf523d
("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>
2023-09-23 10:59:36 +02:00
..
Kconfig erofs: kill all erofs specific fault injection 2019-09-05 20:10:08 +02:00
Makefile
compress.h
data.c erofs: avoid using generic_block_bmap 2020-12-30 11:51:23 +01:00
decompressor.c erofs: avoid consecutive detection for Highmem memory 2022-08-25 11:17:36 +02:00
dir.c erofs: rename errln/infoln/debugln to erofs_{err, info, dbg} 2019-09-05 20:10:09 +02:00
erofs_fs.h erofs: add unsupported inode i_format check 2021-05-11 14:04:02 +02:00
inode.c erofs: add unsupported inode i_format check 2021-05-11 14:04:02 +02:00
internal.h erofs: fix potential overflow calculating xattr_isize 2023-05-17 11:35:35 +02:00
namei.c erofs: rename errln/infoln/debugln to erofs_{err, info, dbg} 2019-09-05 20:10:09 +02:00
super.c erofs: fix shift-out-of-bounds of blkszbits 2021-03-07 12:20:42 +01:00
tagptr.h
utils.c erofs: correct the remaining shrink objects 2020-04-17 10:50:16 +02:00
xattr.c erofs: initialized fields can only be observed after bit is set 2021-03-04 10:26:43 +01:00
xattr.h erofs: use erofs_inode naming 2019-09-05 20:10:07 +02:00
zdata.c erofs: ensure that the post-EOF tails are all zeroed 2023-09-23 10:59:36 +02:00
zdata.h erofs: fix partially uninitialized misuse in z_erofs_onlinepage_fixup 2020-06-30 15:37:07 -04:00
zmap.c erofs: fix compact 4B support for 16k block size 2023-07-27 08:37:35 +02:00
zpvec.h erofs: fix unsafe pagevec reuse of hooked pclusters 2021-11-21 13:38:51 +01:00