linux/fs/erofs
Gao Xiang 9b32b063be erofs: ensure m_llen is reset to 0 if metadata is invalid
Sometimes, the on-disk metadata might be invalid due to user
interrupts, storage failures, or other unknown causes.

In that case, z_erofs_map_blocks_iter() may still return a valid
m_llen while other fields remain invalid (e.g., m_plen can be 0).

Due to the return value of z_erofs_scan_folio() in some path will
be ignored on purpose, the following z_erofs_scan_folio() could
then use the invalid value by accident.

Let's reset m_llen to 0 to prevent this.

Link: https://lore.kernel.org/r/20240629185743.2819229-1-hsiangkao@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2024-06-30 10:54:28 +08:00
..
compress.h erofs: Zstandard compression support 2024-05-09 07:46:56 +08:00
data.c Changes since last update: 2024-05-24 09:31:50 -07:00
decompressor_deflate.c erofs: avoid allocating DEFLATE streams before mounting 2024-05-21 03:07:39 +08:00
decompressor_lzma.c erofs: refine managed cache operations to folios 2024-03-10 18:41:25 +08:00
decompressor_zstd.c erofs: Zstandard compression support 2024-05-09 07:46:56 +08:00
decompressor.c erofs: Zstandard compression support 2024-05-09 07:46:56 +08:00
dir.c erofs_buf: store address_space instead of inode 2024-04-25 00:57:14 -04:00
erofs_fs.h erofs: Zstandard compression support 2024-05-09 07:46:56 +08:00
fscache.c erofs: don't align offset for erofs_read_metabuf() (simple cases) 2024-05-18 01:47:26 +08:00
inode.c erofs: mechanically convert erofs_read_metabuf() to offsets 2024-05-18 01:46:18 +08:00
internal.h bd_inode series 2024-05-21 09:51:42 -07:00
Kconfig erofs: Zstandard compression support 2024-05-09 07:46:56 +08:00
Makefile erofs: Zstandard compression support 2024-05-09 07:46:56 +08:00
namei.c erofs_buf: store address_space instead of inode 2024-04-25 00:57:14 -04:00
super.c erofs: convert to use super_set_uuid to support for FS_IOC_GETFSUUID 2024-06-26 17:02:28 +08:00
sysfs.c erofs: make kobj_type structures constant 2023-02-15 08:11:26 +08:00
xattr.c erofs_buf: store address_space instead of inode 2024-04-25 00:57:14 -04:00
xattr.h erofs: move erofs_xattr_handlers and xattr_handler_map to .rodata 2023-10-09 16:24:17 +02:00
zdata.c z_erofs_pcluster_begin(): don't bother with rounding position down 2024-05-18 01:53:04 +08:00
zmap.c erofs: ensure m_llen is reset to 0 if metadata is invalid 2024-06-30 10:54:28 +08:00
zutil.c erofs: fix possible memory leak in z_erofs_gbuf_exit() 2024-06-26 17:02:15 +08:00