[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <67d6efbbc9ac6db23215660cb970b7ef29dc0c1d.camel@perches.com>
Date: Thu, 29 Aug 2019 08:58:17 -0700
From: Joe Perches <joe@...ches.com>
To: Gao Xiang <gaoxiang25@...wei.com>,
Christoph Hellwig <hch@...radead.org>
Cc: 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>,
David Sterba <dsterba@...e.cz>,
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
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 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.
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