[PATCH v2] mkfs: Fix input offset counting in headerball mode
Mike Baynton
mike at mbaynton.com
Wed Nov 13 01:50:03 AEDT 2024
On Mon, Nov 11, 2024 at 7:05 PM Gao Xiang <hsiangkao at linux.alibaba.com> wrote:
>
> Hi Mike,
>
> I will add "erofs-utils:" prefix to the patch subject but no need
> to add "Co-developed-by" tag.
>
> Btw, if some converter for headerball files from tarballs is
> available in public? It'd be better to get some tests for this
> feature. `ddtaridx` is designed by some other team in Alibaba
> so I don't have a valid simple generator/converter too...
The converter we've made is in Go, could that be incorporated into your tests?
>
> Thanks,
> Gao Xiang
>
> >
> > lib/tar.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/tar.c b/lib/tar.c
> > index b32abd4..990c6cb 100644
> > --- a/lib/tar.c
> > +++ b/lib/tar.c
> > @@ -808,13 +808,14 @@ out_eot:
> > }
> >
> > dataoff = tar->offset;
> > - if (!(tar->headeronly_mode || tar->ddtaridx_mode))
> > - tar->offset += st.st_size;
> > + tar->offset += st.st_size;
> > switch(th->typeflag) {
> > case '0':
> > case '7':
> > case '1':
> > st.st_mode |= S_IFREG;
> > + if (tar->headeronly_mode || tar->ddtaridx_mode)
> > + tar->offset -= st.st_size;
> > break;
> > case '2':
> > st.st_mode |= S_IFLNK;
>
More information about the Linux-erofs
mailing list