Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1843746ybe; Tue, 3 Sep 2019 04:28:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxM4VZis/KKe4kLWe7w8dwRF8iBYajaWIZSmOEUnm5e/5hBVU/6dtjzm+tEMx/r70nxjacW X-Received: by 2002:a17:90a:e501:: with SMTP id t1mr17722438pjy.25.1567510111561; Tue, 03 Sep 2019 04:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567510111; cv=none; d=google.com; s=arc-20160816; b=mCcv/yYhjqXRm34ci8tQcQGre45o5sNtY9sAh7W6iVlhu+7HHjB7p6ihMQ2QD5+gs5 g6RVi+Vbbcq8/5UboMYUJs1N5cEA1OgYBwnf0LasCcCLrZsu3a9bcDwr69z79GMePNP3 VhZ80WRJqqhE0yyXjizAW+WL7f6FyqYpUutHPXUxb2/5nqizssUal76wj9eF635rgKgU r9VXzLw9Vw8L4U6fU8k/Das3R56mS8pFHRAqaH1avEG3aCb18BjIc3lqaqPrKWwWfujo 6YKuAnzLWZc51XEo6gi61f6h9pRtdVjPTK6ubYOjB3S8uEVTTOCeEm1lTuMgqpVJyN4t 9h6Q== 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:message-id:subject:to :from:date; bh=7Hgq2+vrkNN/UJnhQ1IFVdtcPWZNW7ipQqtiZZjjYMo=; b=pzgSgO/nPcNTQLvwaTwBwuQMySozLdIrUThKtF+GIWr10bU98dmyf1HA0Kn3X8te/u zUalELid94UJY0JljxsBWdZTiIEnqzaEFTHlgjVh1TGah+jfh+moMMoGEO6bPF5H9ise s53H6hI7UcGIJIVN/Pr5ByPye5N6RU//njEuwA4mBp/gAs65TDfJHAATqzGFUKjmuHKK gB/8jdEk4Jd1664pDzm/2TWFSOzhv9VHxxb8xcEl+VwjeOQVczmiEKMVRLejJ7QD53tk tmRZeW91dZUl3/Otx94NPCBStY89klqRKaRsPKty7x3PPtaio7y3lC9qBMEIpleKaFI8 o3LA== 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 s24si14328419pgq.372.2019.09.03.04.28.15; Tue, 03 Sep 2019 04:28:31 -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 S1728963AbfICL1N (ORCPT + 99 others); Tue, 3 Sep 2019 07:27:13 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:44464 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728270AbfICL1N (ORCPT ); Tue, 3 Sep 2019 07:27:13 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id BFF3C819EF; Tue, 3 Sep 2019 13:26:54 +0200 (CEST) Date: Tue, 3 Sep 2019 13:27:07 +0200 From: Pavel Machek To: dsterba@suse.cz, Pavel Machek , Joe Perches , Gao Xiang , Christoph Hellwig , Alexander Viro , Greg Kroah-Hartman , Andrew Morton , Stephen Rothwell , Theodore Ts'o , 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: <20190903112707.GA3844@amd> References: <20190802125347.166018-1-gaoxiang25@huawei.com> <20190802125347.166018-2-gaoxiang25@huawei.com> <20190829095954.GB20598@infradead.org> <20190829103252.GA64893@architecture4> <67d6efbbc9ac6db23215660cb970b7ef29dc0c1d.camel@perches.com> <20190830120714.GN2752@twin.jikos.cz> <20190902084303.GC19557@amd> <20190902140712.GV2752@twin.jikos.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yrj/dFKFPuw6o+aM" Content-Disposition: inline In-Reply-To: <20190902140712.GV2752@twin.jikos.cz> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > No. gdb tells you what the actual offsets _are_. >=20 > Ok, reading your reply twice, I think we have different perspectives. I > don't trust the comments. >=20 > The tool I had in mind is pahole that parses dwarf information about the > structures, the same as gdb does. The actual value of the struct members > is the thing that needs to be investigated in memory dumps or disk image > dumps. >=20 > > > > The expected offset is somewhat valuable, but > > > > perhaps the form is a bit off given the visual > > > > run-in to the field types. > > > >=20 > > > > The extra work with this form is manipulating all > > > > the offsets whenever a structure change occurs. > > >=20 > > > ... while this is error prone. > >=20 > > While the comment tells you what they _should be_. >=20 > That's exactly the source of confusion and bugs. For me an acceptable > way of asserting that a value has certain offset is a build check, eg. > like >=20 > BUILD_BUG_ON(strct my_superblock, magic, 16); Yes, that would work, too. As would documentation file with the disk structures. Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --yrj/dFKFPuw6o+aM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl1uTgsACgkQMOfwapXb+vL2IgCgs+lvDMnGJBdzf4Ded3ls5qz4 u/sAn1m34p0fdk6NLGSW8jaPems7I5EL =38MN -----END PGP SIGNATURE----- --yrj/dFKFPuw6o+aM--