Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2308228ybl; Thu, 9 Jan 2020 10:25:13 -0800 (PST) X-Google-Smtp-Source: APXvYqw046Pbafm5/4RrbP+w10UBwvGoJPJqcQIXfxzgQ8QCwAX/1ARk9maLtjpcI+Ec4dbIosu+ X-Received: by 2002:a05:6830:155a:: with SMTP id l26mr9914861otp.339.1578594313680; Thu, 09 Jan 2020 10:25:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578594313; cv=none; d=google.com; s=arc-20160816; b=WWGuN2+IgIYu8QU/tvwixV5Kv1ay45EIY+1dIY2KrYJF2myMO+7mkx3CETxbCxqIxI FzFVLX2DiQwbJ4WatiHluNwRqbt42ezm+fuk7Bhf/lPMYQQRxvmZ+2cNW60yJGZxNr2D V4Ov+t6n48RZjt/bT4VoyYxjVpFaQeC7JM2ck1JuC+SysYoyWIu6szUedg51nTs+bZDu fsi/UhZQhzvN4fxS/9vSDGuKfrTE075yAiyujZGFX4/VWKGFSfmlQBjbUZsX48kKdTHl GJBRg9oeZjHSXK+o6Zl29xePXXsC9BGzPSDVLp4PUeG4uTVmBzfDgMg7xAsoK3YqgYZL Pl3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:to:subject; bh=2xEEqBoHJXB4WAMMf0IFPHoBj/iH3CU4zR8fmOEnO20=; b=iTDfQUxy7zPTa5RQakmH1rnR/uTReXRGVlncAbXSByG3X+blftUqEWAt1S/eWVfc8Z 3nAE1YoDuoBRTRG16h6z1wRKBx8xHexyfjjlKOT4A5giDSZD7YQBbdVbddLNVBWKd2oV 11XD8Cw+l/TSyX6Ga3uZSuIhoSkdt0hUcrpueMAomrW4TeRRWXYd0UnGolvelkgn8Swp myCFHMi8Pum4/trSIh4oVftwe4l1aioI28/JhKtZ3n/zW/kqdCCD8j2OIGysp0riF+PD WQxvrRmtxyG6daKW8RE7+xYuuZSjZIx3614CaBRMtcbiIFdyem3E9YgN7QcQ4xeKIiez nYew== 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 y23si4194287oti.65.2020.01.09.10.25.01; Thu, 09 Jan 2020 10:25:13 -0800 (PST) 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 S1728707AbgAIPBl (ORCPT + 99 others); Thu, 9 Jan 2020 10:01:41 -0500 Received: from sandeen.net ([63.231.237.45]:58362 "EHLO sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbgAIPBk (ORCPT ); Thu, 9 Jan 2020 10:01:40 -0500 Received: from [10.0.0.4] (liberator [10.0.0.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 492551167E; Thu, 9 Jan 2020 09:01:39 -0600 (CST) Subject: Re: [PATCH] xfs: Fix xfs_dir2_sf_entry_t size check To: Vincenzo Frascino , darrick.wong@oracle.com, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200109141459.21808-1-vincenzo.frascino@arm.com> From: Eric Sandeen Autocrypt: addr=sandeen@sandeen.net; prefer-encrypt=mutual; keydata= mQINBE6x99QBEADMR+yNFBc1Y5avoUhzI/sdR9ANwznsNpiCtZlaO4pIWvqQJCjBzp96cpCs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MGmn0kxJUAEQEAAYkCHwQY AQIACQUCTrH31AIbDAAKCRAgrhaS4T3e4BKwD/0ZOOmUNOZCSOLAMjZx3mtYtjYgfUNKi0ki YPveGoRWTqbis8UitPtNrG4XxgzLOijSdOEzQwkdOIp/QnZhGNssMejCnsluK0GQd+RkFVWN mcQT78hBeGcnEMAXZKq7bkIKzvc06GFmkMbX/gAl6DiNGv0UNAX+5FYh+ucCJZSyAp3sA+9/ LKjxnTedX0aygXA6rkpX0Y0FvN/9dfm47+LGq7WAqBOyYTU3E6/+Z72bZoG/cG7ANLxcPool LOrU43oqFnD8QwcN56y4VfFj3/jDF2MX3xu4v2OjglVjMEYHTCxP3mpxesGHuqOit/FR+mF0 MP9JGfj6x+bj/9JMBtCW1bY/aPeMdPGTJvXjGtOVYblGZrSjXRn5++Uuy36CvkcrjuziSDG+ JEexGxczWwN4mrOQWhMT5Jyb+18CO+CWxJfHaYXiLEW7dI1AynL4jjn4W0MSiXpWDUw+fsBO Pk6ah10C4+R1Jc7dyUsKksMfvvhRX1hTIXhth85H16706bneTayZBhlZ/hK18uqTX+s0onG/ m1F3vYvdlE4p2ts1mmixMF7KajN9/E5RQtiSArvKTbfsB6Two4MthIuLuf+M0mI4gPl9SPlf fWCYVPhaU9o83y1KFbD/+lh1pjP7bEu/YudBvz7F2Myjh4/9GUAijrCTNeDTDAgvIJDjXuLX pA== Message-ID: Date: Thu, 9 Jan 2020 09:01:38 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20200109141459.21808-1-vincenzo.frascino@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/9/20 8:14 AM, Vincenzo Frascino wrote: > xfs_check_ondisk_structs() verifies that the sizes of the data types > used by xfs are correct via the XFS_CHECK_STRUCT_SIZE() macro. > > xfs_dir2_sf_entry_t size is set erroneously to 3 which breaks the > compilation with the assertion below: > > In file included from linux/include/linux/string.h:6, > from linux/include/linux/uuid.h:12, > from linux/fs/xfs/xfs_linux.h:10, > from linux/fs/xfs/xfs.h:22, > from linux/fs/xfs/xfs_super.c:7: > In function ‘xfs_check_ondisk_structs’, > inlined from ‘init_xfs_fs’ at linux/fs/xfs/xfs_super.c:2025:2: > linux/include/linux/compiler.h:350:38: > error: call to ‘__compiletime_assert_107’ declared with attribute > error: XFS: sizeof(xfs_dir2_sf_entry_t) is wrong, expected 3 > _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) > > Restore the correct behavior defining the correct size. # pahole -C xfs_dir2_sf_entry fs/xfs/xfs.o struct xfs_dir2_sf_entry { __u8 namelen; /* 0 1 */ __u8 offset[2]; /* 1 2 */ __u8 name[0]; /* 3 0 */ /* size: 3, cachelines: 1, members: 3 */ /* last cacheline: 3 bytes */ }; Can you please the same command on your machine, along with which arm abi is in use etc just for clarity? -Eric > Cc: "Darrick J. Wong" > Signed-off-by: Vincenzo Frascino > --- > fs/xfs/xfs_ondisk.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/xfs/xfs_ondisk.h b/fs/xfs/xfs_ondisk.h > index b6701b4f59a9..ee487ddc60c7 100644 > --- a/fs/xfs/xfs_ondisk.h > +++ b/fs/xfs/xfs_ondisk.h > @@ -104,7 +104,7 @@ xfs_check_ondisk_structs(void) > XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_hdr_t, 16); > XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_t, 16); > XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_tail_t, 4); > - XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_entry_t, 3); > + XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_entry_t, 4); > XFS_CHECK_OFFSET(xfs_dir2_sf_entry_t, namelen, 0); > XFS_CHECK_OFFSET(xfs_dir2_sf_entry_t, offset, 1); > XFS_CHECK_OFFSET(xfs_dir2_sf_entry_t, name, 3); >