Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2495364rdf; Mon, 6 Nov 2023 16:43:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCJ7cO7FVdbQbb8Qk/HzNkk6+RJPY4wjIIV5rDMJxTK892sxhPXH9BsR21OMqexEKRV5Pc X-Received: by 2002:a05:6830:1e57:b0:6cd:a9d:bc57 with SMTP id e23-20020a0568301e5700b006cd0a9dbc57mr30422482otj.32.1699317812900; Mon, 06 Nov 2023 16:43:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699317812; cv=none; d=google.com; s=arc-20160816; b=Xe435gvlynAHt/hInYKQhyfDLJrpLOszpVHcruKzUP6xY05G683cADqFEQOJZwFAlA D9pid+fctrgq363KfrY7SSHRZhqJ222IAtHfVhP8xOkfJBrgWi1ziMGGO67+B+IpVTS4 acp1aHXVKEuM0N5pkIO6eLp48+4Peeste5cyynfA2T22G0o1ISSHDWTji8IaAftvxoWj H5f5EoitV8m7boSZFWHE1ijLRcU6vrsIE/PQrDLNpShddKp7ngvsXwLcy9wfABhI3SiA mgZgPYEmErDf0prpz/phxMHP01u0+NX7TwNJzYRmqRf5yDZLnGhheQvFxIr/i4bn0ZdL ijkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=C6HnxRoOPPImtylzQDYeZiH0FMhR4x9tENVXHd4saCI=; fh=b4yDpRzQZjxnD1UgrAWHsnqbJi+dpOTTrJVVaKbGA28=; b=0W/OE7byTL+nsHkhaDEuSxOWp+TFc3PxuzCvOzOFzbW7q5YKb4sHctyuN6hIUogkXb rWVwaK7Lj4JsBlSHKiUALUYll+woinA+HRVTLiyOqWbk0wUi1+y+8ebbEdkiGZmS0JdG 4JNJYboq465rpwYJ6qxQNKIY3GxBgWDI/DNEAuBvvrEbNyLT7Er4nq7KwvQVtn8l6LlP D7yrmEpPAQo7Q2/+eRSj0AcYJrazYxZxeBPQSSFYGYoSkgu8b/eTXjie1bjKr7I3HZ9V Rfx7p4lrQORxRt+TP+4fTnSmF4xXv323aiy7jTmPrHpnjklLSm9DMTJqHI+ojWap3+s3 7MzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Pyyr4jJ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id eg25-20020a056a00801900b006b618af5cd5si9884819pfb.300.2023.11.06.16.43.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 16:43:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Pyyr4jJ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 03ED28106788; Mon, 6 Nov 2023 16:43:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233143AbjKGAnb (ORCPT + 99 others); Mon, 6 Nov 2023 19:43:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjKGAna (ORCPT ); Mon, 6 Nov 2023 19:43:30 -0500 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [IPv6:2001:41d0:1004:224b::bc]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCD45D75 for ; Mon, 6 Nov 2023 16:43:26 -0800 (PST) Date: Mon, 6 Nov 2023 19:43:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1699317805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=C6HnxRoOPPImtylzQDYeZiH0FMhR4x9tENVXHd4saCI=; b=Pyyr4jJ5gMNHCJajjVwQncqEuF65FVFmLBbOhW6sOQI9bbomEEQlSpmTDRG1Bqqh0/d0PN fD7AaPSCQ9EZ1FzI2aKwws15ibXFiRL/mjpIeGS8+Cc51D5Sb80gfuWkErerJn5lMiL7xs 7RtZsT+E8yqZAuiAyyWbrW2DMqCEPuA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: "Gustavo A. R. Silva" Cc: Brian Foster , linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH][next] bcachefs: Use DECLARE_FLEX_ARRAY() helper and fix multiple -Warray-bounds warnings Message-ID: <20231107004321.onldaaepahzapwz5@moria.home.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 06 Nov 2023 16:43:32 -0800 (PST) On Mon, Nov 06, 2023 at 04:27:02PM -0600, Gustavo A. R. Silva wrote: > Transform zero-length array `s` into a proper flexible-array > member in `struct snapshot_table` via the DECLARE_FLEX_ARRAY() > helper; and fix tons of the following -Warray-bounds warnings: > > fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] > fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] > fs/bcachefs/snapshot.c:135:70: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] > fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] > fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] > fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] > > This helps with the ongoing efforts to globally enable -Warray-bounds. > > Signed-off-by: Gustavo A. R. Silva Thanks, applied