Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2418295rdf; Mon, 6 Nov 2023 13:41:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGcvN+VY8+ndiIgPneDRwqxjuNsGKuxcwRKgQ0xg5TP9OwD13/6Wzh1Q0lFz1+T8M+t10KQ X-Received: by 2002:a05:6a00:b55:b0:690:d4f5:c664 with SMTP id p21-20020a056a000b5500b00690d4f5c664mr25387459pfo.11.1699306915961; Mon, 06 Nov 2023 13:41:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699306915; cv=none; d=google.com; s=arc-20160816; b=pmIXCgREcIwn25vOm4k3db4cwfGxupnHwkuvzthB/fYf4EZvJUH6kVgS73OVVNBSDI UxJzw5FL7ywfdO03cjyOjopkU085J6nWoVfKx+2n8ra8k1vv3qUNuIy2Dg2Nlejs7oQ5 xc/bAT2MGUts8SW/vVg2nJ3k8rtmXjU4Gzmmw4YvlW5Z6735ZG2Gnn9VuwF+duoAX90I hdlIl9jVUZks5c903GUL7bcbLxd8On0feav7jac6l46g8JBwB7FT9FTRGuKQolWlXB7/ 74Zdsva3eVDDTFC9qSakaIQvr3e2La77ok3u4TxupijlMOyYJxJEA00GGx8YfYPqexrM vWWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=ReQice1s9pMoA8UuwIKdJc7pXC5hSoRHb/P7kfsLg1E=; fh=a9DUR2BkWEeP0cACbiaI2xwcDvDVC/gt15O7/cIFKdk=; b=RdCdajINkgyIqg7jmy4D/VSRQTDi9tgcSJ75l0d16MJgPK5RxH7V+2HqeyaoTFQoXv cAfB3WWme9f6j2cO6aDuLgVF1UvWh0+emGPoxwleljI0Rdf9B+b9kZxTydYSukt8Zj23 HdsiNhBjoISYjMWEt1IlAP327+S+IFAo0ZbgqOtjUUZbb99rBdxknhPxq+6JqNVdUKt+ vzBeX2WVgZPtqdwz53my493Zw7FNtDs8OiMaeAMIYyyMGVlaAYLD7oDdOlGFZ0gkaQac ko/rJD/RsKg4WrhDGzgUdwsWflefPckNox8tvAc2ckDPQ9yJPa35+c2yWrb2chPOkT5F wNNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i6oviTFN; 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=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id x38-20020a056a000be600b00690204af234si8179715pfu.378.2023.11.06.13.41.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 13:41:55 -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=@kernel.org header.s=k20201202 header.b=i6oviTFN; 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=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2EB448069F33; Mon, 6 Nov 2023 13:40:38 -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 S233168AbjKFVka (ORCPT + 99 others); Mon, 6 Nov 2023 16:40:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233132AbjKFVk2 (ORCPT ); Mon, 6 Nov 2023 16:40:28 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34D11BB; Mon, 6 Nov 2023 13:40:26 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29F6DC433C7; Mon, 6 Nov 2023 21:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699306825; bh=+FlwfuDUvVPFaF514DQDx020nBoDR412BR5BhhOaIUU=; h=Date:From:To:Cc:Subject:From; b=i6oviTFNJJgL/F00kQA4tzkaef5Fij8X9EzWV19SYaqbwwMj2i8HshOtWuNJ8JmFe TbNFqqv7X2bwjOjYkj64yT6jfJ4qz6Eei9JM7+cxH6HXRQGahfzG1owbxhgZnH+oBA ROZsbQGOFtmGEEmmUHZhgRpdMinJ7IFw1B9J6a/SUPht0bfjsA78aIiga3xEY6BnmV dBR32BmRWkmoPiVUYJRLnWA6ePf7AM2b201vNla+z8msEbeEAMxOv8/nH3y0n7Gdc2 AG0X/gLfyq7DHfU6CVwNp5HFe2VRdreC9c9IWDkGnGiY0AKSNqxHg+9GbGwi//FXTY EAtQtVW0bMRLg== Date: Mon, 6 Nov 2023 15:40:22 -0600 From: "Gustavo A. R. Silva" To: Kent Overstreet , Brian Foster Cc: linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH][next] bcachefs: Fix multiple -Warray-bounds warnings Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 13:40:38 -0800 (PST) Transform zero-length array `entries` into a proper flexible-array member in `struct journal_seq_blacklist_table`; and fix the following -Warray-bounds warnings: fs/bcachefs/journal_seq_blacklist.c:148:26: warning: array subscript idx is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] fs/bcachefs/journal_seq_blacklist.c:150:30: warning: array subscript idx is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] fs/bcachefs/journal_seq_blacklist.c:154:27: warning: array subscript idx is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] fs/bcachefs/journal_seq_blacklist.c:176:27: warning: array subscript i is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] fs/bcachefs/journal_seq_blacklist.c:177:27: warning: array subscript i is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] fs/bcachefs/journal_seq_blacklist.c:297:34: warning: array subscript i is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] fs/bcachefs/journal_seq_blacklist.c:298:34: warning: array subscript i is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] fs/bcachefs/journal_seq_blacklist.c:300:31: warning: array subscript i is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] This results in no differences in binary output. This helps with the ongoing efforts to globally enable -Warray-bounds. Signed-off-by: Gustavo A. R. Silva --- fs/bcachefs/bcachefs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h index 53ffa88cae16..e42f2977f7aa 100644 --- a/fs/bcachefs/bcachefs.h +++ b/fs/bcachefs/bcachefs.h @@ -612,7 +612,7 @@ struct journal_seq_blacklist_table { u64 start; u64 end; bool dirty; - } entries[0]; + } entries[]; }; struct journal_keys { -- 2.34.1