Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-09-03 Thread Pavel Machek
Hi! > > No. gdb tells you what the actual offsets _are_. > > Ok, reading your reply twice, I think we have different perspectives. I > don't trust the comments. > > The tool I had in mind is pahole that parses dwarf information about the > structures, the same as gdb does. The actual value of th

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-09-02 Thread David Sterba
On Mon, Sep 02, 2019 at 10:43:03AM +0200, Pavel Machek wrote: > > > > Rather than they didn't run "gdb" or "pahole" and change it by mistake. > > > > > > I think Christoph is not right here. > > > > > > Using external tools for validation is extra work > > > when necessary for understanding the c

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 05:45:21AM -0700, Christoph Hellwig wrote: > On Sun, Sep 01, 2019 at 03:54:11PM +0800, Gao Xiang wrote: > > It could be better has a name though, because 1) erofs.mkfs uses this > > definition explicitly, and we keep this on-disk definition erofs_fs.h > > file

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-09-02 Thread Christoph Hellwig
On Sun, Sep 01, 2019 at 03:54:11PM +0800, Gao Xiang wrote: > It could be better has a name though, because 1) erofs.mkfs uses this > definition explicitly, and we keep this on-disk definition erofs_fs.h > file up with erofs-utils. > > 2) For kernel use, first we have, >datamode < EROFS_INODE_L

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-09-02 Thread Gao Xiang
Hi Pavel, (Thanks...) On Mon, Sep 02, 2019 at 10:40:20AM +0200, Pavel Machek wrote: > > So __packed is right thing to do. If architecture accesses that > slowly, that's ungood, but different structures between architectures > would be really bad. (...a little word, it seems that Christoph was

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-09-02 Thread Pavel Machek
Hi! > > > Rather than they didn't run "gdb" or "pahole" and change it by mistake. > > > > I think Christoph is not right here. > > > > Using external tools for validation is extra work > > when necessary for understanding the code. > > The advantage of using the external tools that the informat

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-09-02 Thread Pavel Machek
Hi! > > +struct erofs_super_block { > > +/* 0 */__le32 magic; /* in the little endian */ > > +/* 4 */__le32 checksum;/* crc32c(super_block) */ > > +/* 8 */__le32 features;/* (aka. feature_compat) */ > > +/* 12 */__u8 blkszbits; /* support block_size == PAGE_SIZ

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-09-01 Thread Gao Xiang
Hi Christoph, Sorry about my first response, sincerely... Here is my redo-ed comments to all your suggestions... On Thu, Aug 29, 2019 at 02:59:54AM -0700, Christoph Hellwig wrote: > > --- /dev/null > > +++ b/fs/erofs/erofs_fs.h > > @@ -0,0 +1,316 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only O

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-08-30 Thread Gao Xiang
Hi David, On Fri, Aug 30, 2019 at 02:07:14PM +0200, David Sterba wrote: > On Thu, Aug 29, 2019 at 08:58:17AM -0700, Joe Perches wrote: > > On Thu, 2019-08-29 at 18:32 +0800, Gao Xiang wrote: > > > Hi Christoph, > > > > > > On Thu, Aug 29, 2019 at 02:59:54AM -0700, Christoph Hellwig wrote: > > > >

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-08-30 Thread David Sterba
On Thu, Aug 29, 2019 at 08:58:17AM -0700, Joe Perches wrote: > On Thu, 2019-08-29 at 18:32 +0800, Gao Xiang wrote: > > Hi Christoph, > > > > On Thu, Aug 29, 2019 at 02:59:54AM -0700, Christoph Hellwig wrote: > > > > --- /dev/null > > > > +++ b/fs/erofs/erofs_fs.h > > > > @@ -0,0 +1,316 @@ > > > >

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-08-29 Thread Gao Xiang
Hi Joe, On Thu, Aug 29, 2019 at 08:58:17AM -0700, Joe Perches wrote: > On Thu, 2019-08-29 at 18:32 +0800, Gao Xiang wrote: > > Hi Christoph, > > > > On Thu, Aug 29, 2019 at 02:59:54AM -0700, Christoph Hellwig wrote: > > > > --- /dev/null > > > > +++ b/fs/erofs/erofs_fs.h > > > > @@ -0,0 +1,316 @@

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-08-29 Thread Joe Perches
On Thu, 2019-08-29 at 18:32 +0800, Gao Xiang wrote: > Hi Christoph, > > On Thu, Aug 29, 2019 at 02:59:54AM -0700, Christoph Hellwig wrote: > > > --- /dev/null > > > +++ b/fs/erofs/erofs_fs.h > > > @@ -0,0 +1,316 @@ > > > +/* SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0 */ > > > +/* > > > +

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-08-29 Thread Gao Xiang
Hi Christoph, On Thu, Aug 29, 2019 at 02:59:54AM -0700, Christoph Hellwig wrote: [] > > > +static bool erofs_inode_is_data_compressed(unsigned int datamode) > > +{ > > + if (datamode == EROFS_INODE_FLAT_COMPRESSION) > > + return true; > > + return datamode == EROFS_INODE_FLAT_COMP

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-08-29 Thread Gao Xiang
Hi Christoph, On Thu, Aug 29, 2019 at 03:36:04AM -0700, Christoph Hellwig wrote: > On Thu, Aug 29, 2019 at 06:32:53PM +0800, Gao Xiang wrote: > > I can fix it up as you like but I still cannot get > > what is critical issues here. > > The problem is that the whole codebase is way substandard qual

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-08-29 Thread Christoph Hellwig
On Thu, Aug 29, 2019 at 06:32:53PM +0800, Gao Xiang wrote: > I can fix it up as you like but I still cannot get > what is critical issues here. The problem is that the whole codebase is way substandard quality, looking a lot like Linux code from 20 years ago. Yes, we already have plenty of code o

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-08-29 Thread Gao Xiang
Hi Christoph, On Thu, Aug 29, 2019 at 02:59:54AM -0700, Christoph Hellwig wrote: > > --- /dev/null > > +++ b/fs/erofs/erofs_fs.h > > @@ -0,0 +1,316 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0 */ > > +/* > > + * linux/fs/erofs/erofs_fs.h > > Please remove the pointless file name

Re: [PATCH v6 01/24] erofs: add on-disk layout

2019-08-29 Thread Christoph Hellwig
> --- /dev/null > +++ b/fs/erofs/erofs_fs.h > @@ -0,0 +1,316 @@ > +/* SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0 */ > +/* > + * linux/fs/erofs/erofs_fs.h Please remove the pointless file names in the comment headers. > +struct erofs_super_block { > +/* 0 */__le32 magic; /* in

[PATCH v6 01/24] erofs: add on-disk layout

2019-08-02 Thread Gao Xiang
This commit adds the on-disk layout header file of erofs. On-disk format is compatible with erofs-staging added in 4.19. In addition, add EROFS_SUPER_MAGIC_V1 to magic.h. Signed-off-by: Gao Xiang --- fs/erofs/erofs_fs.h| 316 + include/uapi/linux/magi