Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp309011ybe; Mon, 2 Sep 2019 01:51:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPmxGNCkM4LtXb+VL9rBPN1SQ33mBEjgeyM1hm7Kg07Dxa1DBBLTMHEqO7RudK8u8EPnHL X-Received: by 2002:a63:de4c:: with SMTP id y12mr24651236pgi.264.1567414315253; Mon, 02 Sep 2019 01:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567414315; cv=none; d=google.com; s=arc-20160816; b=J1KlaGGy5IghtILbrcMBgwjC0UreULxlnJbCpyNsBhhBCGPdZ7wUDqgare2lG5VY03 2IPBzaYVgurNX8eHRENwMKS9QaKDcyrP09R4IiFMJoOA3zXbHMlVkYi90Rfnr2StUzqb +7+Pcrlox+O/Lwyi+xy6FPAR116QrIhSM8TrCVV5v3xJ2obYBjoRfVx5DwQvIAg8/T5m vKTjXvX+Khh/9sau40leNKJHco+o7RcPatEh3tBiW2jbSHJNlxUgmao9c+M2zsalKmTV yvt7wHflxw2qyddd9ntY1lKWBEPw/IS/K2uIMdDRfVuyyVpVArcfB+P6EifEtt47r5A1 RZ+Q== 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:cc :to:from:date; bh=ZpaBWSYd1gvJun9Xj4OXfJbtMCAezwyg/5OnO09r01o=; b=i8TKelhQTxoquGoqfxkGn8SwK7QnRilg9J4bDzqHDcTLJU/C/cRPtj2LcM22z75Qlk zpoec3OuER2D3dPuenhrn39lE0q8T6NpNdA4oPt1yJjL8nRZ//6yWo01GnjvRcHGyzmL iLXlb+xHiWx9AdTb+p8lVpnCs6w/Fl4dT+6lfvHKL7RWYV+gQDCykGanSALX/HqQvEjr 1adtUUB9esxTUfRJ/Oi1iJnFCGNS+z79l4LuhxXbArPKFE2u1nh1CQ/dlmVlMqhYC/kp VjVz1RZTchojoyGI+tSXEWSvVQFC2sXKy+RAVHAqleUd1/isgV+ZKoBZh2Rem3KCNBrA pCyQ== 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 b5si11542075pla.342.2019.09.02.01.51.40; Mon, 02 Sep 2019 01:51:55 -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 S1730721AbfIBIkX (ORCPT + 99 others); Mon, 2 Sep 2019 04:40:23 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:39009 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729870AbfIBIkX (ORCPT ); Mon, 2 Sep 2019 04:40:23 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 28B04813BA; Mon, 2 Sep 2019 10:40:07 +0200 (CEST) Date: Mon, 2 Sep 2019 10:40:20 +0200 From: Pavel Machek To: Christoph Hellwig Cc: Gao Xiang , 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: <20190902084020.GB19557@amd> References: <20190802125347.166018-1-gaoxiang25@huawei.com> <20190802125347.166018-2-gaoxiang25@huawei.com> <20190829095954.GB20598@infradead.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NMuMz9nt05w80d4+" Content-Disposition: inline In-Reply-To: <20190829095954.GB20598@infradead.org> 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 --NMuMz9nt05w80d4+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > +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 =3D=3D PAGE_SIZE= only */ >=20 > Please remove all the byte offset comments. That is something that can > easily be checked with gdb or pahole. I don't think I agree. gdb will tell you byte offsets _on one architecture_. But filesystem is supposed to be portable between them.=20 > > +/* 64 */__u8 volume_name[16]; /* volume name */ > > +/* 80 */__le32 requirements; /* (aka. feature_incompat) */ > > + > > +/* 84 */__u8 reserved2[44]; > > +} __packed; /* 128 bytes */ >=20 > Please don't add __packed. In this case I think you don't need it > (but double check with pahole), but even if you would need it using > proper padding fields and making sure all fields are naturally aligned > will give you much better code generation on architectures that don't > support native unaligned access. This is on-disk structure, right? drivers/staging/erofs/super.c: struct erofs_super_block *layout; drivers/staging/erofs/super.c: layout =3D (struct erofs_super_block *)((u8 *)bh->b_data So __packed is right thing to do. If architecture accesses that slowly, that's ungood, but different structures between architectures would be really bad. Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --NMuMz9nt05w80d4+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl1s1XQACgkQMOfwapXb+vK1qgCeMhRodxdCMHktGBYzM6YZ0upo P8IAnRXsAoM5UyuAx4MPbJJVq8NtKIG8 =L04e -----END PGP SIGNATURE----- --NMuMz9nt05w80d4+--