]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
erofs: improve decompression error reporting
authorGao Xiang <hsiangkao@linux.alibaba.com>
Thu, 27 Nov 2025 07:31:19 +0000 (15:31 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Fri, 28 Nov 2025 14:00:07 +0000 (22:00 +0800)
commit831faabed8129246c9802af9ad9581a2c1e9eeb9
tree4f58c14af78725f3fe51f280caa8eab981a34db6
parent9ae77198d4815c63fc8ebacc659c71d150d1e51b
erofs: improve decompression error reporting

Change the return type of decompress() from `int` to `const char *` to
provide more informative error diagnostics:

 - A NULL return indicates successful decompression;

 - If IS_ERR(ptr) is true, the return value encodes a standard negative
   errno (e.g., -ENOMEM, -EOPNOTSUPP) identifying the specific error;

 - Otherwise, a non-NULL return points to a human-readable error string,
   and the corresponding error code should be treated as -EFSCORRUPTED.

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/compress.h
fs/erofs/decompressor.c
fs/erofs/decompressor_deflate.c
fs/erofs/decompressor_lzma.c
fs/erofs/decompressor_zstd.c
fs/erofs/zdata.c