linux-stable/fs/erofs
Gao Xiang 9535cd2119 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-06 21:25:28 +01:00
..
Kconfig erofs: use HIPRI by default if per-cpu kthreads are enabled 2023-05-23 16:57:08 +08:00
Makefile erofs: avoid pcpubuf.c inclusion if CONFIG_EROFS_FS_ZIP is off 2023-05-23 16:56:40 +08:00
compress.h erofs: introduce multi-reference pclusters (fully-referenced) 2022-07-22 21:44:27 +08:00
data.c erofs: keep meta inode into erofs_buf 2023-04-17 01:15:50 +08:00
decompressor.c erofs: avoid hardcoded blocksize for subpage block support 2023-04-17 01:15:44 +08:00
decompressor_lzma.c erofs: avoid hardcoded blocksize for subpage block support 2023-04-17 01:15:44 +08:00
dir.c erofs: keep meta inode into erofs_buf 2023-04-17 01:15:50 +08:00
erofs_fs.h erofs: cleanup i_format-related stuffs 2023-04-17 01:15:55 +08:00
fscache.c erofs: avoid hardcoded blocksize for subpage block support 2023-04-17 01:15:44 +08:00
inode.c erofs: fix fsdax unavailability for chunk-based regular files 2023-07-23 13:53:47 +02:00
internal.h erofs: avoid pcpubuf.c inclusion if CONFIG_EROFS_FS_ZIP is off 2023-05-23 16:56:40 +08:00
namei.c erofs: sunset erofs_dbg() 2023-04-17 01:15:54 +08:00
pcpubuf.c erofs: mark z_erofs_lzma_init/erofs_pcpubuf_init w/ __init 2023-03-09 22:49:30 +08:00
super.c erofs: enable long extended attribute name prefixes 2023-04-17 01:15:53 +08:00
sysfs.c erofs: make kobj_type structures constant 2023-02-15 08:11:26 +08:00
utils.c mm: shrinkers: provide shrinkers with names 2022-07-03 18:08:40 -07:00
xattr.c erofs: fix null-ptr-deref caused by erofs_xattr_prefixes_init 2023-05-23 16:56:21 +08:00
xattr.h Changes since last update: 2023-04-24 14:25:39 -07:00
zdata.c erofs: ensure that the post-EOF tails are all zeroed 2023-09-06 21:25:28 +01:00
zmap.c erofs: fix compact 4B support for 16k block size 2023-07-19 16:35:12 +02:00