[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190830121806.GA20984@hsiangkao-HP-ZHAN-66-Pro-G1>
Date: Fri, 30 Aug 2019 20:18:07 +0800
From: Gao Xiang <hsiangkao@....com>
To: dsterba@...e.cz, Joe Perches <joe@...ches.com>,
Gao Xiang <gaoxiang25@...wei.com>,
Christoph Hellwig <hch@...radead.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Theodore Ts'o <tytso@....edu>, Pavel Machek <pavel@...x.de>,
Amir Goldstein <amir73il@...il.com>,
"Darrick J . Wong" <darrick.wong@...cle.com>,
Dave Chinner <david@...morbit.com>,
Jaegeuk Kim <jaegeuk@...nel.org>, Jan Kara <jack@...e.cz>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-fsdevel@...r.kernel.org, devel@...verdev.osuosl.org,
LKML <linux-kernel@...r.kernel.org>,
linux-erofs@...ts.ozlabs.org, Chao Yu <yuchao0@...wei.com>,
Miao Xie <miaoxie@...wei.com>,
Li Guifu <bluce.liguifu@...wei.com>,
Fang Wei <fangwei1@...wei.com>
Subject: Re: [PATCH v6 01/24] erofs: add on-disk layout
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:
> > > > > --- /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.
> > >
> > > Already removed in the latest version.
> > >
> > > > > +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_SIZE only */
> > > >
> > > > Please remove all the byte offset comments. That is something that can
> > > > easily be checked with gdb or pahole.
> > >
> > > I have no idea the actual issue here.
> > > It will help all developpers better add fields or calculate
> > > these offsets in their mind, and with care.
> > >
> > > 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 information about
> offsets is provably correct ...
>
> > The expected offset is somewhat valuable, but
> > perhaps the form is a bit off given the visual
> > run-in to the field types.
> >
> > The extra work with this form is manipulating all
> > the offsets whenever a structure change occurs.
>
> ... while this is error prone.
I will redo a full patchset and comments addressing
what Christoph all said yesterday.
Either form is fine with me for this case, let's remove
them instead.
Thanks,
Gao Xiang
>
> > The comments might be better with a form more like:
> >
> > struct erofs_super_block { /* offset description */
> > __le32 magic; /* 0 */
> > __le32 checksum; /* 4 crc32c(super_block) */
> > __le32 features; /* 8 (aka. feature_compat) */
> > __u8 blkszbits; /* 12 support block_size == PAGE_SIZE only */
Powered by blists - more mailing lists