Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1888039pxb; Mon, 12 Apr 2021 08:58:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNV+uMM7SiNY15PBCRXpUOgao1m61dNkMWCLX4BmONUc0EXtNeleQfrdXqIz7hBQVTdj7I X-Received: by 2002:a17:906:3886:: with SMTP id q6mr27491926ejd.118.1618243118424; Mon, 12 Apr 2021 08:58:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618243118; cv=none; d=google.com; s=arc-20160816; b=yqP3CQlFxL0UU+I0lkpLiNNV+dYu2HpDA7dB9qDyFZ2OnV47htsbO26OTjHFWJa791 QMgbYfBMDvn5pvJS07mvdBsF2WJ7fOHX6eMz3RnorXqc6OYPGd8aFJWBvWwAF1HqEsu4 ZQAdtc/SS42vlVJ49KPLZPKD4Hz0EjgnfndcFPUEjf/AU8A18VcCCloBwtIvF0eAXtyE yHt5Xfny5VGz6uPAibRf+6WNu/5YYRkmaJ1DNYH4wFo3V8xI2JWmxBW9GKwJKF874708 OoSE0G0DSWJ/Rcyli2oU4Smf0vpmynEYWxJezt3HVpT+3/1c3PsX3gjUEybujhaDZ4F9 PJ3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=fQXHp6pOiHKtfsUAenCa0CmRnzZ4eEUllKHNfdQL05A=; b=tKzmDRhj3gLx3NkSUueLLg69SOgmJH1ZDxSoEJ2yWD3YYTeLV2EOt9/WEO86P3vAgH KTCNT0qCGS2bYwuEeiD09jEXdbOaOwi/ZJlRMc1lXtTgldzdUmn3tVk6nkm2BBTwFG/w 24w8SmkutTt8wndrECwCm0Qw4niqh/ZTNzKL2Eq6TZmkWKYivQX8HtYSmzDzglIIPTji R4ZjzR5OEqHiqRLL7JL1dfTK3fBjTdCJYAJXJVK8JogZR4Al4kZzppYr7EhRlcXvEPuK orcib+MgHCqRwMNki17vD9fFm/suk79YQnZHovGTZWS1P3HL9Xv8gTQtf2BBFi0uQaTM XIjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=DyZxCYbP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb13si6697198ejc.613.2021.04.12.08.58.11; Mon, 12 Apr 2021 08:58:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=DyZxCYbP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239633AbhDLP5R (ORCPT + 99 others); Mon, 12 Apr 2021 11:57:17 -0400 Received: from gateway24.websitewelcome.com ([192.185.51.59]:24704 "EHLO gateway24.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238498AbhDLP5Q (ORCPT ); Mon, 12 Apr 2021 11:57:16 -0400 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 03C533E11 for ; Mon, 12 Apr 2021 10:56:57 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id VyvolBffxw11MVyvoloeIH; Mon, 12 Apr 2021 10:56:57 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=fQXHp6pOiHKtfsUAenCa0CmRnzZ4eEUllKHNfdQL05A=; b=DyZxCYbPIyZnLF0Ap9hMbfsgeq 3wBE5tB0qoJPZObyNQyV34G93OqD0hwCalmttT7nrkPvpBs1nCmDsgcUHQcddDJtpj/l9xRUOE0/s Ib58+e0AMvL8nEmtP/5xqEUHVF7Lfyruc1oXR4vXRfimTVorLquADyJREVuJiOaDz6UCRgUx36LUn 36UvrYw/xjceglE8E2gHOd1f6WZk8W3+O4RsD1YIt25AYI7booRk5fq0DAxen/xgSs99UnbKxRiOo C0tI62X8k8DOYCSNp6OjD6S+fsvHuQHMs18C+nl36kHD7OwaxmtlMaETE7q3qPEZSDmDh93XgLEnz Hwt3hRZg==; Received: from 187-162-31-110.static.axtel.net ([187.162.31.110]:33150 helo=[192.168.15.8]) by gator4166.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lVyvo-001NsM-Lt; Mon, 12 Apr 2021 10:56:56 -0500 Subject: Re: [PATCH v4][next] xfs: Replace one-element arrays with flexible-array members To: "Darrick J. Wong" , Christoph Hellwig Cc: "Gustavo A. R. Silva" , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org References: <20210412135611.GA183224@embeddedor> <20210412152906.GA1075717@infradead.org> <20210412154808.GA1670408@magnolia> From: "Gustavo A. R. Silva" Message-ID: Date: Mon, 12 Apr 2021 10:57:07 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210412154808.GA1670408@magnolia> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.162.31.110 X-Source-L: No X-Exim-ID: 1lVyvo-001NsM-Lt X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 187-162-31-110.static.axtel.net ([192.168.15.8]) [187.162.31.110]:33150 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 17 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/12/21 10:48, Darrick J. Wong wrote: > On Mon, Apr 12, 2021 at 04:29:06PM +0100, Christoph Hellwig wrote: >>> Below are the results of running xfstests for "all" with the following >>> configuration in local.config: >> >> ... >> >>> Other tests might need to be run in order to verify everything is working >>> as expected. For such tests, the intervention of the maintainers might be >>> needed. >> >> This is a little weird for a commit log. If you want to show results >> this would be something that goes into a cover letter. > > Agreed, please don't post fstests output in the commit message. OK. I've got it. > >>> +/* >>> + * Calculates the size of structure xfs_efi_log_format followed by an >>> + * array of n number of efi_extents elements. >>> + */ >>> +static inline size_t >>> +sizeof_efi_log_format(size_t n) >>> +{ >>> + return struct_size((struct xfs_efi_log_format *)0, efi_extents, n); >> >> These helpers are completely silly. Just keep the existing open code >> version using sizeof with the one-off removed. > > A couple of revisions ago I specifically asked Gustavo to create these > 'silly' sizeof helpers to clean up... > >>> - (sizeof(struct xfs_efd_log_item) + >>> - (XFS_EFD_MAX_FAST_EXTENTS - 1) * >>> - sizeof(struct xfs_extent)), >>> - 0, 0, NULL); >>> + struct_size((struct xfs_efd_log_item *)0, >>> + efd_format.efd_extents, >>> + XFS_EFD_MAX_FAST_EXTENTS), > > ...these even uglier multiline statements. I was also going to ask for > these kmem cache users to get cleaned up. I'd much rather look at: > > xfs_efi_zone = kmem_cache_create("xfs_efi_item", > sizeof_xfs_efi(XFS_EFI_MAX_FAST_EXTENTS), 0); > if (!xfs_efi_zone) > goto the_drop_zone; > > even if it means another static inline. Yep; I agree[1]. Thanks -- Gustavo [1] https://lore.kernel.org/lkml/63078523-8a57-36f4-228b-1594f0e3b025@embeddedor.com/