Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp644645ybe; Mon, 2 Sep 2019 07:08:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtANN83F35h6KJpu9sfxZ89wPU5nnuyzdQ5/kpQ+ZUWh86jLAtucK9NJjYV8I4V7PK9s3E X-Received: by 2002:a62:2ec7:: with SMTP id u190mr6643005pfu.121.1567433312996; Mon, 02 Sep 2019 07:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567433312; cv=none; d=google.com; s=arc-20160816; b=o6yMTMD+VPz5WAyJSKUflfc0G0vYcDfFHnQpe2jeQlkNVBPTzOMiUzkUFgDsKQJUpY SzCKvTda5TMPFevgSCVPH5G3oUkraa0et1QIiyCSxbO+u9vuSbrICx6KbANfyqk9twHp wrVg5RbUwy93L4r7bdenXZtteehNJme/4aPPLlCiHSV3eof+5X34xNENT8fzm6Ixznx3 aUV353fMW0keUCoK60xQNykDlPgt86wJUnVoob6yPdcxONSU3CHjit8s6Pc0SS5Rfdp9 mE9/S/vAOPL1Rd56tWcThpXkqa75jFNgxPcXN8SzspKExsxU4buVFB3h0K5uWpDZhKSp 4T/g== 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=+thRg6JwK5GcP4Ru1vocOkLjMisfPTInWsty1QC4mjA=; b=kQs5dDJitWZpdCREW3yJY20CiRNowwoDGCcish6zdxnwsrSPZRrtT4/LJ4d6qJA6G2 jWJqyB5Kqvx7d82hjf7u+pX7iI65dhcBQHFdKJaeHysT6Q3GrdYEh55ofqzLhi36vSi4 8eyQDtjW6FYYiqVbWaYG+bLSlvDn+D845GviZ6Loh+4faXeM+pAb8xpnDwyGXBSoISCF xdLoSSBKWWWQ9LMHVWxf9iGFIV4wIVDQw/D2HzmiSRNVS/rB6n5e96s8wCYW4FxTL4d9 42ltDsv3dKBk16bvmfLmTORuQFymbYKen0/U8rbPkeAQfkETXOrRsLzJpFySZRthPpx6 f9Xw== 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 x20si12019299pjq.109.2019.09.02.07.08.01; Mon, 02 Sep 2019 07:08:32 -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 S1731119AbfIBOG4 (ORCPT + 99 others); Mon, 2 Sep 2019 10:06:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:48752 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726766AbfIBOG4 (ORCPT ); Mon, 2 Sep 2019 10:06:56 -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 8DC1FABE9; Mon, 2 Sep 2019 14:06:53 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 4659BDA796; Mon, 2 Sep 2019 16:07:12 +0200 (CEST) Date: Mon, 2 Sep 2019 16:07:12 +0200 From: David Sterba To: Pavel Machek Cc: dsterba@suse.cz, 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: <20190902140712.GV2752@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-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 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190902084303.GC19557@amd> 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 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 code. > > > > The advantage of using the external tools that the information about > > offsets is provably correct ... > > No. gdb tells you what the actual offsets _are_. Ok, reading your reply twice, I think we have different perspectives. I don't trust the comments. 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. > > > 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. > > While the comment tells you what they _should be_. 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 BUILD_BUG_ON(strct my_superblock, magic, 16);