[PATCH v2] erofs-utils: lib: fix compressed packed inodes
Gao Xiang
hsiangkao at linux.alibaba.com
Mon Sep 23 15:32:16 AEST 2024
On 2024/9/23 13:17, danny at orbstack.dev wrote:
> From: Danny Lin <danny at orbstack.dev>
>
> Commit 2fdbd28 fixed uncompressed packed inodes by not always writing
> compressed data, but it broke compressed packed inodes because now
> uncompressed file data is always written after the compressed data.
>
> The new error handling always rewinds with lseek and falls through to
> write_uncompressed_file_from_fd, regardless of whether the compressed
> data was written successfully (ret = 0) or not (ret = -ENOSPC). This
> can result in corrupted files.
>
> Fix it by simplifying the error handling to better match the old code.
>
> Fixes: 2fdbd28 ("erofs-utils: lib: fix uncompressed packed inode")
> Co-authored-by: Gao Xiang <hsiangkao at linux.alibaba.com>
> Signed-off-by: Danny Lin <danny at orbstack.dev>
Reviewed-by: Gao Xiang <hsiangkao at linux.alibaba.com>
Thanks,
Gao Xiang
More information about the Linux-erofs
mailing list