[PATCH] erofs-utils: add missing errors and normalize errors to lower-case
Gao Xiang
hsiangkao at linux.alibaba.com
Sun Jan 30 11:26:12 AEDT 2022
On Sat, Jan 29, 2022 at 09:45:32PM +0200, Igor Ostapenko wrote:
> From: Igor Eisberg <igoreisberg at gmail.com>
>
> Had second thoughts about this change I made, because it's making
> an assumption about the default value of extract_pos (being 0).
>
> Signed-off-by: Igor Ostapenko <igoreisberg at gmail.com>
Thanks for these. I've folded this patch into the previous one
and apply to experimental branch. You can always resend the whole
patch based on -dev or -experimental branch before it's applied
to -dev branch (which I will not rebase).
Also, a minor suggestion, it'd be better to do one thing (or some
related stuffs) in one patch. So here, even extract_pos
modification is needed, IMO, it would be better with a new patch.
Thanks,
Gao Xiang
> ---
> fsck/main.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/fsck/main.c b/fsck/main.c
> index 3be5d66..e669b44 100644
> --- a/fsck/main.c
> +++ b/fsck/main.c
> @@ -136,9 +136,10 @@ static int erofsfsck_parse_options_cfg(int argc, char **argv)
> return -ENOMEM;
> strncpy(fsckcfg.extract_path, optarg, len);
> fsckcfg.extract_path[len] = '\0';
> - /* update position only if path is not root */
> - if (len > 1 || fsckcfg.extract_path[0] != '/')
> - fsckcfg.extract_pos = len;
> + /* if path is root, start writing from position 0 */
> + if (len == 1 && fsckcfg.extract_path[0] == '/')
> + len = 0;
> + fsckcfg.extract_pos = len;
> }
> break;
> case 3:
> --
> 2.30.2
More information about the Linux-erofs
mailing list