Re: [RESEND PATCH 1/2] erofs-utils: lib: don't abort on compression fallback
Gao Xiang <[email protected]>
| Newsgroups | org.ozlabs.lists.linux-erofs |
|---|---|
| Message-ID | <[email protected]> |
Hi Yifan,
On 2026/6/22 11:42, Yifan Zhao wrote:
> -ENOSPC can be a normal compression fallback when fragments are off.
> Keep the global compression context reusable for that case while
> preserving the fatal state for real errors.
>
> Fixes: a729584ef975 ("erofs-utils: mkfs: avoid hanging if fragment is on and tmpdir is full")
> Reported-by: Bastian Schmitz <[email protected]>
> Closes: https://github.com/erofs/erofs-utils/issues/50
> Assisted-by: Codex:GPT-5.5
> Signed-off-by: Yifan Zhao <[email protected]>
> ---
> lib/compress.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/lib/compress.c b/lib/compress.c
> index ea07409..2a43b81 100644
> --- a/lib/compress.c
> +++ b/lib/compress.c
> @@ -2031,7 +2031,11 @@ err_free_idata:
> out:
> #ifdef EROFS_MT_ENABLED
> pthread_mutex_lock(&ictx->mutex);
> - ictx->seg_num = ret < 0 ? INT_MAX : 0;
> + if (ret < 0 && (ret != -ENOSPC || inode->fragment_size))
Thanks for the fix! but why `inode->fragment_size`
is used here?
I guess if (ret < 0 && ret != -ENOSPC) is enough?
Thanks,
Gao Xiang