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 ==

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

Re: [PATCH 02/21] erofs: on-disk format should have explicitly assigned numbers

2019-09-02 Thread Christoph Hellwig
On Sun, Sep 01, 2019 at 01:51:11PM +0800, Gao Xiang wrote: > enum { > - EROFS_INODE_FLAT_PLAIN, > - EROFS_INODE_FLAT_COMPRESSION_LEGACY, > - EROFS_INODE_FLAT_INLINE, > - EROFS_INODE_FLAT_COMPRESSION, > + EROFS_INODE_FLAT_PLAIN = 0, > +

Re: [PATCH 01/21] erofs: remove all the byte offset comments

2019-09-02 Thread Christoph Hellwig
On Sun, Sep 01, 2019 at 01:51:10PM +0800, Gao Xiang wrote: > From: Gao Xiang > > As Christoph suggested [1], "Please remove all the byte offset comments. > that is something that can easily be checked with gdb or pahole." Looks good. If you want to keep them after the field names as someone

Re: [PATCH 10/21] erofs: kill is_inode_layout_compression()

2019-09-02 Thread Christoph Hellwig
Thanks, this looks much better.

Re: [PATCH 09/21] erofs: update erofs symlink stuffs

2019-09-02 Thread Christoph Hellwig
Thanks, this looks much better. > fs/erofs/inode.c| 35 ++- > fs/erofs/internal.h | 10 -- > fs/erofs/super.c| 5 ++--- > 3 files changed, 12 insertions(+), 38 deletions(-) And that diffstat ain't bad either.

Re: [PATCH 07/21] erofs: use erofs_inode naming

2019-09-02 Thread Christoph Hellwig
> { > - struct erofs_vnode *vi = ptr; > - > - inode_init_once(>vfs_inode); > + inode_init_once(&((struct erofs_inode *)ptr)->vfs_inode); Why doesn't this use EROFS_I? This looks a little odd.

Re: [PATCH 11/21] erofs: use dsb instead of layout for ondisk super_block

2019-09-02 Thread Christoph Hellwig
> + dsb = (struct erofs_super_block *)((u8 *)bh->b_data + > +EROFS_SUPER_OFFSET); Not new in this patch, but that u8 cast shouldn't be needed.

Re: [PATCH 03/21] erofs: some macros are much more readable as a function

2019-09-02 Thread Christoph Hellwig
This looks much better now.

Re: [PATCH 04/21] erofs: kill __packed for on-disk structures

2019-09-02 Thread Christoph Hellwig
On Sun, Sep 01, 2019 at 01:51:13PM +0800, Gao Xiang wrote: > From: Gao Xiang > > As Christoph suggested "Please don't add __packed" [1], > remove all __packed except struct erofs_dirent here. > > Note that all on-disk fields except struct erofs_dirent > (12 bytes with a 8-byte nid) in EROFS are

Re: [PATCH 05/21] erofs: update erofs_inode_is_data_compressed helper

2019-09-02 Thread Christoph Hellwig
On Sun, Sep 01, 2019 at 01:51:14PM +0800, Gao Xiang wrote: > From: Gao Xiang > > As Christoph said, "This looks like a really obsfucated > way to write: > return datamode == EROFS_INODE_FLAT_COMPRESSION || > datamode == EROFS_INODE_FLAT_COMPRESSION_LEGACY; " > > Although I

Re: [PATCH 07/21] erofs: use erofs_inode naming

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 05:10:21AM -0700, Christoph Hellwig wrote: > > { > > - struct erofs_vnode *vi = ptr; > > - > > - inode_init_once(>vfs_inode); > > + inode_init_once(&((struct erofs_inode *)ptr)->vfs_inode); > > Why doesn't this use EROFS_I? This looks a little odd.

Re: [PATCH 06/21] erofs: kill erofs_{init,exit}_inode_cache

2019-09-02 Thread Christoph Hellwig
On Sun, Sep 01, 2019 at 01:51:15PM +0800, Gao Xiang wrote: > From: Gao Xiang > > As Christoph said [1] "having this function seems > entirely pointless", let's kill those. Looks much better.

Re: [PATCH 11/21] erofs: use dsb instead of layout for ondisk super_block

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 05:12:34AM -0700, Christoph Hellwig wrote: > > + dsb = (struct erofs_super_block *)((u8 *)bh->b_data + > > + EROFS_SUPER_OFFSET); > > Not new in this patch, but that u8 cast shouldn't be needed. Yes, thanks and will

Re: [PATCH 12/21] erofs: kill verbose debug info in erofs_fill_super

2019-09-02 Thread Christoph Hellwig
On Sun, Sep 01, 2019 at 01:51:21PM +0800, Gao Xiang wrote: > From: Gao Xiang > > As Christoph said [1], "That is some very verbose > debug info. We usually don't add that and let > people trace the function instead. " Note that this applies to most of the infoln users as far as I can tell.

Re: [PATCH v6 03/24] erofs: add super block operations

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 05:51:09AM -0700, Christoph Hellwig wrote: > On Sun, Sep 01, 2019 at 04:54:55PM +0800, Gao Xiang wrote: > > No modification at this... (some comments already right here...) > > > 20 /* 128-byte erofs on-disk super block */ > > 21 struct erofs_super_block {

Re: [PATCH v6 03/24] erofs: add super block operations

2019-09-02 Thread Christoph Hellwig
On Mon, Sep 02, 2019 at 10:43:04PM +0800, Gao Xiang wrote: > Hi Christoph, > > > ... > > > 24 __le32 features;/* (aka. feature_compat) */ > > > ... > > > 38 __le32 requirements;/* (aka. feature_incompat) */ > > > ... > > > 41 }; > > > > This is only cosmetic, why

Re: [PATCH v6 03/24] erofs: add super block operations

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 08:19:10AM -0700, Christoph Hellwig wrote: > On Mon, Sep 02, 2019 at 10:43:04PM +0800, Gao Xiang wrote: > > Hi Christoph, > > > > ... > > > > 24 __le32 features;/* (aka. feature_compat) */ > > > > ... > > > > 38 __le32 requirements;

Re: [PATCH 00/21] erofs: patchset addressing Christoph's comments

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 08:23:23AM -0700, Christoph Hellwig wrote: > On Mon, Sep 02, 2019 at 10:24:52PM +0800, Gao Xiang wrote: > > > code quality stuff. We're not addressing the issues with large amounts > > > of functionality duplicating VFS helpers. > > > > You means killing

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 <

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

Re: [PATCH v8 11/24] erofs: introduce xattr & posixacl support

2019-09-02 Thread Christoph Hellwig
On Mon, Sep 02, 2019 at 04:20:37PM +0200, David Sterba wrote: > Oh right, I think the reasons are historical and that we can remove the > options nowadays. From the compatibility POV this should be safe, with > ACLs compiled out, no tool would use them, and no harm done when the > code is present

Re: [PATCH v8 11/24] erofs: introduce xattr & posixacl support

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 08:06:40AM -0700, Christoph Hellwig wrote: > On Mon, Sep 02, 2019 at 04:20:37PM +0200, David Sterba wrote: > > Oh right, I think the reasons are historical and that we can remove the > > options nowadays. From the compatibility POV this should be safe, with >

Re: [PATCH 00/21] erofs: patchset addressing Christoph's comments

2019-09-02 Thread Christoph Hellwig
On Mon, Sep 02, 2019 at 10:24:52PM +0800, Gao Xiang wrote: > > code quality stuff. We're not addressing the issues with large amounts > > of functionality duplicating VFS helpers. > > You means killing erofs_get_meta_page or avoid erofs_read_raw_page? > > - For killing erofs_get_meta_page,

Re: [PATCH v8 11/24] erofs: introduce xattr & posixacl support

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 08:06:40AM -0700, Christoph Hellwig wrote: > On Mon, Sep 02, 2019 at 04:20:37PM +0200, David Sterba wrote: > > Oh right, I think the reasons are historical and that we can remove the > > options nowadays. From the compatibility POV this should be safe, with >

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 12/21] erofs: kill verbose debug info in erofs_fill_super

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 05:14:24AM -0700, Christoph Hellwig wrote: > On Sun, Sep 01, 2019 at 01:51:21PM +0800, Gao Xiang wrote: > > From: Gao Xiang > > > > As Christoph said [1], "That is some very verbose > > debug info. We usually don't add that and let > > people trace the

Re: [PATCH 20/21] erofs: kill use_vmap module parameter

2019-09-02 Thread Christoph Hellwig
> @@ -224,9 +220,6 @@ static void *erofs_vmap(struct page **pages, unsigned int > count) > { > int i = 0; > > - if (use_vmap) > - return vmap(pages, count, VM_MAP, PAGE_KERNEL); > - > while (1) { > void *addr = vm_map_ram(pages, count, -1,

Re: [PATCH 21/21] erofs: save one level of indentation

2019-09-02 Thread Christoph Hellwig
On Sun, Sep 01, 2019 at 01:51:30PM +0800, Gao Xiang wrote: > From: Gao Xiang > > As Christoph said [1], ".. and save one > level of indentation." Thanks. Just a little cleanup, but cumulated things like this really help readability.

Re: [PATCH 16/21] erofs: kill magic underscores

2019-09-02 Thread Christoph Hellwig
On Mon, Sep 02, 2019 at 08:39:37PM +0800, Gao Xiang wrote: > > > > > + if (erofs_inode_version(advise) == EROFS_INODE_LAYOUT_V2) { > > > > I still need to wade through the old thread - but didn't you say this > > wasn't really a new vs old version but a compat vs full inode? Maybe > > the names

Re: [PATCH v8 11/24] erofs: introduce xattr & posixacl support

2019-09-02 Thread Chao Yu
On 2019-9-2 21:06, David Sterba wrote: > On Mon, Sep 02, 2019 at 05:57:11AM -0700, Christoph Hellwig wrote: >>> +config EROFS_FS_XATTR >>> + bool "EROFS extended attributes" >>> + depends on EROFS_FS >>> + default y >>> + help >>> + Extended attributes are name:value pairs associated

Re: [PATCH 00/21] erofs: patchset addressing Christoph's comments

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 05:46:45AM -0700, Christoph Hellwig wrote: > On Sun, Sep 01, 2019 at 01:51:09PM +0800, Gao Xiang wrote: > > Hi, > > > > This patchset is based on the following patch by Pratik Shinde, > >

Re: [PATCH 14/21] erofs: kill prio and nofail of erofs_get_meta_page()

2019-09-02 Thread Christoph Hellwig
Thanks, much better. I'm still hoping REQ_PRIO in this current form will go entirely away soon as well.

Re: [PATCH 13/21] erofs: simplify erofs_grab_bio() since bio_alloc() never fail

2019-09-02 Thread Christoph Hellwig
On Sun, Sep 01, 2019 at 01:51:22PM +0800, Gao Xiang wrote: > From: Gao Xiang > > As Christoph pointed out [1], "erofs_grab_bio tries to > handle a bio_alloc failure, except that the function will > not actually fail due the mempool backing it." > > Sorry about useless code, fix it now. A lot

Re: [PATCH 16/21] erofs: kill magic underscores

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 05:26:27AM -0700, Christoph Hellwig wrote: > > > > - vi->datamode = __inode_data_mapping(advise); > > + vi->datamode = erofs_inode_data_mapping(advise); > > > > if (vi->datamode >= EROFS_INODE_LAYOUT_MAX) { > > While you are at it can we aim for

Re: [PATCH 00/21] erofs: patchset addressing Christoph's comments

2019-09-02 Thread Christoph Hellwig
On Sun, Sep 01, 2019 at 01:51:09PM +0800, Gao Xiang wrote: > Hi, > > This patchset is based on the following patch by Pratik Shinde, > https://lore.kernel.org/linux-erofs/20190830095615.10995-1-pratikshinde...@gmail.com/ > > All patches addressing Christoph's comments on v6, which are trivial, >

Re: [PATCH v8 11/24] erofs: introduce xattr & posixacl support

2019-09-02 Thread Christoph Hellwig
> +config EROFS_FS_XATTR > + bool "EROFS extended attributes" > + depends on EROFS_FS > + default y > + help > + Extended attributes are name:value pairs associated with inodes by > + the kernel or by users (see the attr(5) manual page, or visit > +

Re: [PATCH v8 11/24] erofs: introduce xattr & posixacl support

2019-09-02 Thread David Sterba
On Mon, Sep 02, 2019 at 05:57:11AM -0700, Christoph Hellwig wrote: > > +config EROFS_FS_XATTR > > + bool "EROFS extended attributes" > > + depends on EROFS_FS > > + default y > > + help > > + Extended attributes are name:value pairs associated with inodes by > > + the kernel or by

Re: [PATCH v8 11/24] erofs: introduce xattr & posixacl support

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 05:57:11AM -0700, Christoph Hellwig wrote: > > +config EROFS_FS_XATTR > > + bool "EROFS extended attributes" > > + depends on EROFS_FS > > + default y > > + help > > + Extended attributes are name:value pairs associated with inodes by > > +

Re: [PATCH 07/21] erofs: use erofs_inode naming

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 05:47:37AM -0700, Christoph Hellwig wrote: > On Mon, Sep 02, 2019 at 08:13:06PM +0800, Gao Xiang wrote: > > Hi Christoph, > > > > On Mon, Sep 02, 2019 at 05:10:21AM -0700, Christoph Hellwig wrote: > > > > { > > > > - struct erofs_vnode *vi = ptr; > >

Re: [PATCH 16/21] erofs: kill magic underscores

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 05:54:38AM -0700, Christoph Hellwig wrote: > On Mon, Sep 02, 2019 at 08:39:37PM +0800, Gao Xiang wrote: > > > > > > > + if (erofs_inode_version(advise) == EROFS_INODE_LAYOUT_V2) { > > > > > > I still need to wade through the old thread - but didn't

Re: [PATCH v8 11/24] erofs: introduce xattr & posixacl support

2019-09-02 Thread David Sterba
On Mon, Sep 02, 2019 at 09:51:59PM +0800, Chao Yu wrote: > On 2019-9-2 21:06, David Sterba wrote: > > On Mon, Sep 02, 2019 at 05:57:11AM -0700, Christoph Hellwig wrote: > >>> +config EROFS_FS_XATTR > >>> + bool "EROFS extended attributes" > >>> + depends on EROFS_FS > >>> + default y > >>> + help

Re: [PATCH 18/21] erofs: add "erofs_" prefix for common and short functions

2019-09-02 Thread Christoph Hellwig
Thanks. I don't have a tree with all these applies, but please make sure this covers at least all inlines in headers and all methods wired up to operation structures.

Re: [PATCH 17/21] erofs: use a switch statement when dealing with the file modes

2019-09-02 Thread Christoph Hellwig
Thanks, this looks much nicer.

Re: [PATCH 16/21] erofs: kill magic underscores

2019-09-02 Thread Christoph Hellwig
> > - vi->datamode = __inode_data_mapping(advise); > + vi->datamode = erofs_inode_data_mapping(advise); > > if (vi->datamode >= EROFS_INODE_LAYOUT_MAX) { While you are at it can we aim for some naming consistency here? The inode member is called is called datamode, the helper

Re: [PATCH 20/21] erofs: kill use_vmap module parameter

2019-09-02 Thread Gao Xiang
Hi Christoph, On Mon, Sep 02, 2019 at 05:31:24AM -0700, Christoph Hellwig wrote: > > @@ -224,9 +220,6 @@ static void *erofs_vmap(struct page **pages, unsigned > > int count) > > { > > int i = 0; > > > > - if (use_vmap) > > - return vmap(pages, count, VM_MAP, PAGE_KERNEL); > >

Re: [PATCH 07/21] erofs: use erofs_inode naming

2019-09-02 Thread Christoph Hellwig
On Mon, Sep 02, 2019 at 08:13:06PM +0800, Gao Xiang wrote: > Hi Christoph, > > On Mon, Sep 02, 2019 at 05:10:21AM -0700, Christoph Hellwig wrote: > > > { > > > - struct erofs_vnode *vi = ptr; > > > - > > > - inode_init_once(>vfs_inode); > > > + inode_init_once(&((struct erofs_inode

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 > >

Re: [PATCH v6 05/24] erofs: add inode operations

2019-09-02 Thread David Sterba
On Sun, Sep 01, 2019 at 05:34:00PM +0800, Gao Xiang wrote: > > > +static int read_inode(struct inode *inode, void *data) > > > +{ > > > + struct erofs_vnode *vi = EROFS_V(inode); > > > + struct erofs_inode_v1 *v1 = data; > > > + const unsigned int advise = le16_to_cpu(v1->i_advise); > > > +

Re: [PATCH v6 05/24] erofs: add inode operations

2019-09-02 Thread Gao Xiang
Hi David, On Mon, Sep 02, 2019 at 03:43:29PM +0200, David Sterba wrote: > On Sun, Sep 01, 2019 at 05:34:00PM +0800, Gao Xiang wrote: > > > > +static int read_inode(struct inode *inode, void *data) > > > > +{ > > > > + struct erofs_vnode *vi = EROFS_V(inode); > > > > + struct