Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp640403ybl; Fri, 30 Aug 2019 05:08:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrw0uCvcMiiDoQ88Qz4WEt0JogLXBrZBPFbShhoA2x1WZ/1RhbZSWolQwalz9xhiWUqGl2 X-Received: by 2002:a17:902:9348:: with SMTP id g8mr15702720plp.18.1567166898434; Fri, 30 Aug 2019 05:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567166898; cv=none; d=google.com; s=arc-20160816; b=P7S9h2mIuxqPAm4FZ9j/mNMEDjTORxtEGw/S2EgTTsM6E32LBv9K2tEf513Y9AURCD FMKi2HSW2Bjlv0cOiJwrOUiIshuAyejBkgViLm4z+KGFbSwm/EdjlAcT2vTEijRB8b1q ogVyUyNkUwTthK+hSkvL6TasMK2CZ6cgZKTndEgAKaEllnH2nE9WKQ3xV56Q3UgUEFN/ HZxEbVjfLfNfhfIuxNDLMA0q9XJgWfZNK3nO9xHP33iy7KTztUpGNrL0hXJ5AZ1IdBer aYK48m8CYFxwhIjMHTEaWkYJHhwOYB7QbZOwYqFqIETQkQWDmfZFdHLR1hHwpbrVtvXw HqtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :reply-to:message-id:subject:cc:to:from:date; bh=6lhj7LtrMlKUt+3wPowZMY33bMl+jCGjrQ//CqVFrgs=; b=gGsfYwP4WyYbXUrk3gNEsoL2rJjpM14eRQvdeJN1OMHtTgW4VSdvTPS/KOJtRYItB9 78m8BWFz0+nAN9Z1RRjmsbOGEJb9Dsd22IHt0k5JcS/vA1LV00UC8wr2pH/57qpsR0jl 1lTFTToK4fxqL6RpGog2ywk+R8Z3LepZpejlqkA7D9Qu3/jn9BxHlL5wvKdNwzuchTG/ h6lY2U6vjDbcyROR886Or2GyVBN9N87jAMr2sVDhkaTfF2mXAFwJRozyH4SCxfupEU8n ALJ+hJQCgljyT+2ddreAq8+9JGMi5YxeqwxZaClV4Gi5/D+m2lTVChcngG2PSBAk0Qpt zRKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9si4742120pjs.72.2019.08.30.05.08.01; Fri, 30 Aug 2019 05:08:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727976AbfH3MGz (ORCPT + 99 others); Fri, 30 Aug 2019 08:06:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:53832 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727933AbfH3MGz (ORCPT ); Fri, 30 Aug 2019 08:06:55 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0B3E4B662; Fri, 30 Aug 2019 12:06:53 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 4079DDA809; Fri, 30 Aug 2019 14:07:14 +0200 (CEST) Date: Fri, 30 Aug 2019 14:07:14 +0200 From: David Sterba To: Joe Perches Cc: Gao Xiang , Christoph Hellwig , Alexander Viro , Greg Kroah-Hartman , Andrew Morton , Stephen Rothwell , Theodore Ts'o , Pavel Machek , David Sterba , Amir Goldstein , "Darrick J . Wong" , Dave Chinner , Jaegeuk Kim , Jan Kara , Linus Torvalds , linux-fsdevel@vger.kernel.org, devel@driverdev.osuosl.org, LKML , linux-erofs@lists.ozlabs.org, Chao Yu , Miao Xie , Li Guifu , Fang Wei Subject: Re: [PATCH v6 01/24] erofs: add on-disk layout Message-ID: <20190830120714.GN2752@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Joe Perches , Gao Xiang , Christoph Hellwig , Alexander Viro , Greg Kroah-Hartman , Andrew Morton , Stephen Rothwell , Theodore Ts'o , Pavel Machek , Amir Goldstein , "Darrick J . Wong" , Dave Chinner , Jaegeuk Kim , Jan Kara , Linus Torvalds , linux-fsdevel@vger.kernel.org, devel@driverdev.osuosl.org, LKML , linux-erofs@lists.ozlabs.org, Chao Yu , Miao Xie , Li Guifu , Fang Wei References: <20190802125347.166018-1-gaoxiang25@huawei.com> <20190802125347.166018-2-gaoxiang25@huawei.com> <20190829095954.GB20598@infradead.org> <20190829103252.GA64893@architecture4> <67d6efbbc9ac6db23215660cb970b7ef29dc0c1d.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <67d6efbbc9ac6db23215660cb970b7ef29dc0c1d.camel@perches.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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 */