From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE353CDB47E for ; Wed, 18 Oct 2023 17:44:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 567178D0182; Wed, 18 Oct 2023 13:44:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 515D78D0016; Wed, 18 Oct 2023 13:44:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3DE598D0182; Wed, 18 Oct 2023 13:44:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 2C0AA8D0016 for ; Wed, 18 Oct 2023 13:44:19 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id EA2DA1403B0 for ; Wed, 18 Oct 2023 17:44:18 +0000 (UTC) X-FDA: 81359306196.08.E12E480 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by imf30.hostedemail.com (Postfix) with ESMTP id BAACC80005 for ; Wed, 18 Oct 2023 17:44:15 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=GRlo7Rrp; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf30.hostedemail.com: domain of lkp@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697651057; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=hB2bMVV356WG7mldJcGuAnPabnvOTqnX+t34qi/fFG0=; b=lbib4WDfggaLqWTF66jjFFhlLONLzXRc04SCkzjapCNarpTbBi22eNIyNtxZ4ffHkhMrMX UDzeYlbIqPro2bbEKUB1NZW0qxxB6ngh9IVzYVIeCutyAUTwHYy1n1uLJdKUiQ710wPug8 +Y6SPAQHBuK8UFnW4gdgQR1NUMFbZ+A= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=GRlo7Rrp; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf30.hostedemail.com: domain of lkp@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697651057; a=rsa-sha256; cv=none; b=Ltkcr5vtRenk3dPsriJoxs+JAcvmUavLpmy7xeko3uc8LQShUdFdIey2HnwZ2t3phAhXCl 5/sxhv61jukvQ5coVkcTR6ihHcU8KJAffBPN1OyutLPB5M87vjlA2H0rJ6CMGrYAA6B+H4 FLJ89geE2JIjaDSLzj6nu9hLL0bymEE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697651055; x=1729187055; h=date:from:to:cc:subject:message-id:mime-version; bh=MmaQ0OkQBNshCxSmfvzXH8wBQtSkrdJFsv8v+kH8Qyc=; b=GRlo7RrpPuyGtsZCR2y8XQg50dHvrTl5LPWpTFB5pszZ6snuB+eP508q MvfyE30unu7OsS37KAyEFFfM/fnbn24b4YNOqZVb49djBtPFfDrYPesxS U6e/p47EeRz5A+bRvxdK0t5PvTkt+SulIodI26t4zVambqGA2ZjnEt2sD wROZ0IQaUv6s8sEzo/BvrpgXRmI0H99EdjHWns7emLLknjURauqDtz6zT nFUaZGIjqxhcYILaTpAS9J5Xqjg9TQNgOV+fShwhErV+RyBKCdyLijgxb FgzNIM3P/KTcyK3wkKjIvc45X260SrVVgkYoxacPBJnZVVkj2OAMb5UNZ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="472300421" X-IronPort-AV: E=Sophos;i="6.03,235,1694761200"; d="scan'208";a="472300421" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2023 10:44:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="873118681" X-IronPort-AV: E=Sophos;i="6.03,235,1694761200"; d="scan'208";a="873118681" Received: from lkp-server01.sh.intel.com (HELO 8917679a5d3e) ([10.239.97.150]) by fmsmga002.fm.intel.com with ESMTP; 18 Oct 2023 10:44:12 -0700 Received: from kbuild by 8917679a5d3e with local (Exim 4.96) (envelope-from ) id 1qtAaY-0000lo-18; Wed, 18 Oct 2023 17:44:10 +0000 Date: Thu, 19 Oct 2023 01:43:18 +0800 From: kernel test robot To: Kent Overstreet Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List Subject: [linux-next:master 3892/13299] fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' Message-ID: <202310190116.5JjceoZJ-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: BAACC80005 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: uyrjsrworzoq81j3r8amnk8gmsgyws1k X-HE-Tag: 1697651055-131651 X-HE-Meta: U2FsdGVkX18VqVWMLsOay/3Q/D9k9zOmlku02c5/Gw4PhaDJZ4/ygDEQwY1vlv8QNJ4NV2Yx2Pj1pufsS9bmaAb8j9o/o+/vZTp8CPKnh6CMS/2PNjxZM2q+z/+qy8cVTwvLPQ1RkMJx3J+qOvEvP9/Eg2hCpz/nozot+3vDz1zeat4vPZhkv9fB/Ms+e3wPO9xv/VtpULodqp7XfJdgN/WV7bh+1+Cfn5rrbdzRUokRBW9q5mHS93ZWDKes0QAzRn7N55HwgxSrQ3OXog5Av1491Vlz6ApQStg4ausm73R7x5VgZVhzG5WW1ST/yFl5T6r+fAKxMIiUtS7PQ+RnetLQ3+fdFve/hmKl8JpOsx5m/xMAxqVzUWugVIjk2Ku+Np9TncKv8z9cOMaJAK/ux/dG+daJuFXyk1qt0gg/gSoyUNJZlpYWeCP7Ei+axYNMA8Q1L7lLA0Q1ALPH4PZQloei0lm79zNiHcKZdCxUnicwQ66PAHPRRm2c65Fi9/z3yUKMXQR9B7tuCl3WEO11DDPpGnb/cAgKcOfbeEjKFUVNtk+93v3i7xgljNvEf5UOtj7CCMrhfvGwsMGWOKGDCDCC6Tkd458lsqcqhqJg+qUtPuV1t3I7d5NRl7794SJ+m+pyFthTjzlZuc/DjDZBRM47L3SOnpMWCvzABULCmQY9M+3KcNGiAbgEZQwkLlG1bE/TbxIjOT8I/IdROegDLIANIDdKP4/3De4vsS8DfhJg5KR9XBzqgPsLsevlmwii6sSEl89GEg2H8J5gsFsVM7Z0enH/zP3soLUFhAjs6G+JUaeXnFT7fai+hapu1P/egXdWGR6ulFASyRxBQAYh0niwbhZa7+zk39ugNQp0iOi6OoC3pzBx+QmBX1bPpPN7jekYLTo5aqkG4jfHIz9PpHwtHpQ/A47PGp1m4GoTN5A0mGqoiG3kbi3uekDiq/kpO9zxUpuuo4TkudtrJKl UDk+g4u6 EYMLR0Z5QKK50Ya2Zj1oMBQaMXJT0fyfHfj9Kczixp/OyVJP+eByFaWjZHO2bbBMHo8d9+rWxl2ZNE/tjytYr0xwU7TfogbE597v4tRxhcTdei1Vq2IZ1OKUrS0d6Cj27zQx0SF323gg5y4jrWiTiPHG/j2cVK4Y/k+WM1MoTclbEhZCY27iS8FoJLggstmoNenzRh3ln4OhGk+QMMrgvfWfXH30NDl3ATbA1eXWNdSwC6UtRszhPFijSM77yRVkePm9PRUjFfOTO2iajXcvkQxkdx/y+bnElIgWJM9V82ULszGs6F9F5ESpcUlgQN/ZBEV2zwG4SCIur7rX0EkKZsz1E1J0ocJX9X4uU X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 2dac75696c6da3c848daa118a729827541c89d33 commit: 68d1c81e582aac9ad93ff6c663a0b5af7c5777b2 [3892/13299] bcachefs: Split out snapshot.c config: csky-allmodconfig (https://download.01.org/0day-ci/archive/20231019/202310190116.5JjceoZJ-lkp@intel.com/config) compiler: csky-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231019/202310190116.5JjceoZJ-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202310190116.5JjceoZJ-lkp@intel.com/ All warnings (new ones prefixed by >>): fs/bcachefs/bcachefs_format.h:868:14: warning: 'INODE_STR_HASH_OFFSET' defined but not used [-Wunused-const-variable=] 868 | LE32_BITMASK(INODE_STR_HASH, struct bch_inode, bi_flags, 20, 24); | ^~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:101:25: note: in definition of macro 'LE_BITMASK' 101 | static const unsigned name##_OFFSET = offset; \ | ^~~~ fs/bcachefs/bcachefs_format.h:868:1: note: in expansion of macro 'LE32_BITMASK' 868 | LE32_BITMASK(INODE_STR_HASH, struct bch_inode, bi_flags, 20, 24); | ^~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:678:14: warning: 'BTREE_PTR_RANGE_UPDATED_MAX' defined but not used [-Wunused-const-variable=] 678 | LE16_BITMASK(BTREE_PTR_RANGE_UPDATED, struct bch_btree_ptr_v2, flags, 0, 1); | ^~~~~~~~~~~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:103:25: note: in definition of macro 'LE_BITMASK' 103 | static const __u##_bits name##_MAX = (1ULL << (end - offset)) - 1; \ | ^~~~ fs/bcachefs/bcachefs_format.h:678:1: note: in expansion of macro 'LE16_BITMASK' 678 | LE16_BITMASK(BTREE_PTR_RANGE_UPDATED, struct bch_btree_ptr_v2, flags, 0, 1); | ^~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:678:14: warning: 'BTREE_PTR_RANGE_UPDATED_BITS' defined but not used [-Wunused-const-variable=] 678 | LE16_BITMASK(BTREE_PTR_RANGE_UPDATED, struct bch_btree_ptr_v2, flags, 0, 1); | ^~~~~~~~~~~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:102:25: note: in definition of macro 'LE_BITMASK' 102 | static const unsigned name##_BITS = (end - offset); \ | ^~~~ fs/bcachefs/bcachefs_format.h:678:1: note: in expansion of macro 'LE16_BITMASK' 678 | LE16_BITMASK(BTREE_PTR_RANGE_UPDATED, struct bch_btree_ptr_v2, flags, 0, 1); | ^~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:678:14: warning: 'BTREE_PTR_RANGE_UPDATED_OFFSET' defined but not used [-Wunused-const-variable=] 678 | LE16_BITMASK(BTREE_PTR_RANGE_UPDATED, struct bch_btree_ptr_v2, flags, 0, 1); | ^~~~~~~~~~~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:101:25: note: in definition of macro 'LE_BITMASK' 101 | static const unsigned name##_OFFSET = offset; \ | ^~~~ fs/bcachefs/bcachefs_format.h:678:1: note: in expansion of macro 'LE16_BITMASK' 678 | LE16_BITMASK(BTREE_PTR_RANGE_UPDATED, struct bch_btree_ptr_v2, flags, 0, 1); | ^~~~~~~~~~~~ In file included from fs/bcachefs/btree_trans_commit.c:9: In function 'want_new_bset', inlined from 'bch2_btree_node_prep_for_write' at fs/bcachefs/btree_trans_commit.c:77:6: fs/bcachefs/btree_update_interior.h:274:50: warning: array subscript 0 is outside array bounds of 'struct bkey_packed[0]' [-Warray-bounds=] 274 | __bch_btree_u64s_remaining(c, b, &bne->keys.start[0]); | ^~~~~~~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h: In function 'bch2_btree_node_prep_for_write': fs/bcachefs/bcachefs_format.h:2297:36: note: while referencing 'start' 2297 | struct bkey_packed start[0]; | ^~~~~ In file included from include/linux/build_bug.h:5, from include/linux/container_of.h:5, from include/linux/list.h:5, from include/linux/backing-dev-defs.h:5, from fs/bcachefs/bcachefs.h:186: fs/bcachefs/btree_trans_commit.c: In function 'bch2_trans_commit_write_locked.isra': fs/bcachefs/btree_trans_commit.c:703:35: warning: array subscript 0 is outside array bounds of 'struct bkey_i[0]' [-Warray-bounds=] 703 | bkey_copy(&entry->start[0], &wb->k); include/linux/compiler.h:77:45: note: in definition of macro 'unlikely' 77 | # define unlikely(x) __builtin_expect(!!(x), 0) | ^ fs/bcachefs/util.h:28:33: note: in expansion of macro 'BUG_ON' 28 | #define EBUG_ON(cond) BUG_ON(cond) | ^~~~~~ fs/bcachefs/bkey.h:101:9: note: in expansion of macro 'EBUG_ON' 101 | EBUG_ON((u64 *) (_dst) > (u64 *) (_src) && \ | ^~~~~~~ fs/bcachefs/btree_trans_commit.c:703:25: note: in expansion of macro 'bkey_copy' 703 | bkey_copy(&entry->start[0], &wb->k); | ^~~~~~~~~ fs/bcachefs/bcachefs_format.h:1542:33: note: while referencing 'start' 1542 | struct bkey_i start[0]; | ^~~~~ fs/bcachefs/btree_trans_commit.c:687:33: warning: array subscript 0 is outside array bounds of 'struct bkey_i[0]' [-Warray-bounds=] 687 | bkey_reassemble(&entry->start[0], | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 688 | (struct bkey_s_c) { &i->old_k, i->old_v }); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:1542:33: note: while referencing 'start' 1542 | struct bkey_i start[0]; | ^~~~~ fs/bcachefs/btree_trans_commit.c:695:35: warning: array subscript 0 is outside array bounds of 'struct bkey_i[0]' [-Warray-bounds=] 695 | bkey_copy(&entry->start[0], i->k); include/linux/compiler.h:77:45: note: in definition of macro 'unlikely' 77 | # define unlikely(x) __builtin_expect(!!(x), 0) | ^ fs/bcachefs/util.h:28:33: note: in expansion of macro 'BUG_ON' 28 | #define EBUG_ON(cond) BUG_ON(cond) | ^~~~~~ fs/bcachefs/bkey.h:101:9: note: in expansion of macro 'EBUG_ON' 101 | EBUG_ON((u64 *) (_dst) > (u64 *) (_src) && \ | ^~~~~~~ fs/bcachefs/btree_trans_commit.c:695:25: note: in expansion of macro 'bkey_copy' 695 | bkey_copy(&entry->start[0], i->k); | ^~~~~~~~~ fs/bcachefs/bcachefs_format.h:1542:33: note: while referencing 'start' 1542 | struct bkey_i start[0]; | ^~~~~ In file included from fs/bcachefs/btree_trans_commit.c:17: In function '__snapshot_t', inlined from 'snapshot_t' at fs/bcachefs/snapshot.h:41:9, inlined from 'bch2_snapshot_is_internal_node' at fs/bcachefs/snapshot.h:142:6, inlined from 'btree_insert_entry_checks' at fs/bcachefs/btree_trans_commit.c:268:2, inlined from 'do_bch2_trans_commit.isra' at fs/bcachefs/btree_trans_commit.c:831:3: >> fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] 36 | return &t->s[U32_MAX - id]; | ~~~~^~~~~~~~~~~~~~ In file included from fs/bcachefs/bcachefs.h:419: fs/bcachefs/subvolume_types.h: In function 'do_bch2_trans_commit.isra': fs/bcachefs/subvolume_types.h:23:33: note: while referencing 's' 23 | struct snapshot_t s[0]; | ^ -- fs/bcachefs/bcachefs_format.h:870:1: note: in expansion of macro 'LE32_BITMASK' 870 | LE32_BITMASK(INODE_NEW_VARINT, struct bch_inode, bi_flags, 31, 32); | ^~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:869:14: warning: 'INODE_NR_FIELDS_MAX' defined but not used [-Wunused-const-variable=] 869 | LE32_BITMASK(INODE_NR_FIELDS, struct bch_inode, bi_flags, 24, 31); | ^~~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:103:25: note: in definition of macro 'LE_BITMASK' 103 | static const __u##_bits name##_MAX = (1ULL << (end - offset)) - 1; \ | ^~~~ fs/bcachefs/bcachefs_format.h:869:1: note: in expansion of macro 'LE32_BITMASK' 869 | LE32_BITMASK(INODE_NR_FIELDS, struct bch_inode, bi_flags, 24, 31); | ^~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:869:14: warning: 'INODE_NR_FIELDS_BITS' defined but not used [-Wunused-const-variable=] 869 | LE32_BITMASK(INODE_NR_FIELDS, struct bch_inode, bi_flags, 24, 31); | ^~~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:102:25: note: in definition of macro 'LE_BITMASK' 102 | static const unsigned name##_BITS = (end - offset); \ | ^~~~ fs/bcachefs/bcachefs_format.h:869:1: note: in expansion of macro 'LE32_BITMASK' 869 | LE32_BITMASK(INODE_NR_FIELDS, struct bch_inode, bi_flags, 24, 31); | ^~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:869:14: warning: 'INODE_NR_FIELDS_OFFSET' defined but not used [-Wunused-const-variable=] 869 | LE32_BITMASK(INODE_NR_FIELDS, struct bch_inode, bi_flags, 24, 31); | ^~~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:101:25: note: in definition of macro 'LE_BITMASK' 101 | static const unsigned name##_OFFSET = offset; \ | ^~~~ fs/bcachefs/bcachefs_format.h:869:1: note: in expansion of macro 'LE32_BITMASK' 869 | LE32_BITMASK(INODE_NR_FIELDS, struct bch_inode, bi_flags, 24, 31); | ^~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:868:14: warning: 'INODE_STR_HASH_MAX' defined but not used [-Wunused-const-variable=] 868 | LE32_BITMASK(INODE_STR_HASH, struct bch_inode, bi_flags, 20, 24); | ^~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:103:25: note: in definition of macro 'LE_BITMASK' 103 | static const __u##_bits name##_MAX = (1ULL << (end - offset)) - 1; \ | ^~~~ fs/bcachefs/bcachefs_format.h:868:1: note: in expansion of macro 'LE32_BITMASK' 868 | LE32_BITMASK(INODE_STR_HASH, struct bch_inode, bi_flags, 20, 24); | ^~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:868:14: warning: 'INODE_STR_HASH_BITS' defined but not used [-Wunused-const-variable=] 868 | LE32_BITMASK(INODE_STR_HASH, struct bch_inode, bi_flags, 20, 24); | ^~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:102:25: note: in definition of macro 'LE_BITMASK' 102 | static const unsigned name##_BITS = (end - offset); \ | ^~~~ fs/bcachefs/bcachefs_format.h:868:1: note: in expansion of macro 'LE32_BITMASK' 868 | LE32_BITMASK(INODE_STR_HASH, struct bch_inode, bi_flags, 20, 24); | ^~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:868:14: warning: 'INODE_STR_HASH_OFFSET' defined but not used [-Wunused-const-variable=] 868 | LE32_BITMASK(INODE_STR_HASH, struct bch_inode, bi_flags, 20, 24); | ^~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:101:25: note: in definition of macro 'LE_BITMASK' 101 | static const unsigned name##_OFFSET = offset; \ | ^~~~ fs/bcachefs/bcachefs_format.h:868:1: note: in expansion of macro 'LE32_BITMASK' 868 | LE32_BITMASK(INODE_STR_HASH, struct bch_inode, bi_flags, 20, 24); | ^~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:678:14: warning: 'BTREE_PTR_RANGE_UPDATED_MAX' defined but not used [-Wunused-const-variable=] 678 | LE16_BITMASK(BTREE_PTR_RANGE_UPDATED, struct bch_btree_ptr_v2, flags, 0, 1); | ^~~~~~~~~~~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:103:25: note: in definition of macro 'LE_BITMASK' 103 | static const __u##_bits name##_MAX = (1ULL << (end - offset)) - 1; \ | ^~~~ fs/bcachefs/bcachefs_format.h:678:1: note: in expansion of macro 'LE16_BITMASK' 678 | LE16_BITMASK(BTREE_PTR_RANGE_UPDATED, struct bch_btree_ptr_v2, flags, 0, 1); | ^~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:678:14: warning: 'BTREE_PTR_RANGE_UPDATED_BITS' defined but not used [-Wunused-const-variable=] 678 | LE16_BITMASK(BTREE_PTR_RANGE_UPDATED, struct bch_btree_ptr_v2, flags, 0, 1); | ^~~~~~~~~~~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:102:25: note: in definition of macro 'LE_BITMASK' 102 | static const unsigned name##_BITS = (end - offset); \ | ^~~~ fs/bcachefs/bcachefs_format.h:678:1: note: in expansion of macro 'LE16_BITMASK' 678 | LE16_BITMASK(BTREE_PTR_RANGE_UPDATED, struct bch_btree_ptr_v2, flags, 0, 1); | ^~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:678:14: warning: 'BTREE_PTR_RANGE_UPDATED_OFFSET' defined but not used [-Wunused-const-variable=] 678 | LE16_BITMASK(BTREE_PTR_RANGE_UPDATED, struct bch_btree_ptr_v2, flags, 0, 1); | ^~~~~~~~~~~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:101:25: note: in definition of macro 'LE_BITMASK' 101 | static const unsigned name##_OFFSET = offset; \ | ^~~~ fs/bcachefs/bcachefs_format.h:678:1: note: in expansion of macro 'LE16_BITMASK' 678 | LE16_BITMASK(BTREE_PTR_RANGE_UPDATED, struct bch_btree_ptr_v2, flags, 0, 1); | ^~~~~~~~~~~~ In file included from fs/bcachefs/btree_update.c:14: In function '__snapshot_t', inlined from 'snapshot_t' at fs/bcachefs/snapshot.h:41:9: fs/bcachefs/snapshot.h:36:16: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] 36 | return &t->s[U32_MAX - id]; | ^~~~~~~~~~~~~~~~~~~ In file included from fs/bcachefs/bcachefs.h:419: fs/bcachefs/subvolume_types.h: In function 'snapshot_t': fs/bcachefs/subvolume_types.h:23:33: note: while referencing 's' 23 | struct snapshot_t s[0]; | ^ In function '__snapshot_t', inlined from 'snapshot_t' at fs/bcachefs/snapshot.h:41:9, inlined from '__bch2_snapshot_parent' at fs/bcachefs/snapshot.h:70:15, inlined from 'bch2_snapshot_parent' at fs/bcachefs/snapshot.h:87:7, inlined from 'need_whiteout_for_snapshot' at fs/bcachefs/btree_update.c:140:7: >> fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] 36 | return &t->s[U32_MAX - id]; | ~~~~^~~~~~~~~~~~~~ fs/bcachefs/subvolume_types.h: In function 'need_whiteout_for_snapshot': fs/bcachefs/subvolume_types.h:23:33: note: while referencing 's' 23 | struct snapshot_t s[0]; | ^ In function '__snapshot_t', inlined from 'snapshot_t' at fs/bcachefs/snapshot.h:41:9, inlined from '__bch2_snapshot_parent' at fs/bcachefs/snapshot.h:73:6, inlined from 'bch2_snapshot_parent' at fs/bcachefs/snapshot.h:87:7, inlined from 'need_whiteout_for_snapshot' at fs/bcachefs/btree_update.c:140:7: >> fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] 36 | return &t->s[U32_MAX - id]; | ~~~~^~~~~~~~~~~~~~ fs/bcachefs/subvolume_types.h: In function 'need_whiteout_for_snapshot': fs/bcachefs/subvolume_types.h:23:33: note: while referencing 's' 23 | struct snapshot_t s[0]; | ^ In function '__snapshot_t', inlined from 'snapshot_t' at fs/bcachefs/snapshot.h:41:9, inlined from '__bch2_snapshot_parent' at fs/bcachefs/snapshot.h:73:34, inlined from 'bch2_snapshot_parent' at fs/bcachefs/snapshot.h:87:7, inlined from 'need_whiteout_for_snapshot' at fs/bcachefs/btree_update.c:140:7: >> fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] 36 | return &t->s[U32_MAX - id]; | ~~~~^~~~~~~~~~~~~~ fs/bcachefs/subvolume_types.h: In function 'need_whiteout_for_snapshot': fs/bcachefs/subvolume_types.h:23:33: note: while referencing 's' 23 | struct snapshot_t s[0]; | ^ In function '__snapshot_t', inlined from 'snapshot_t' at fs/bcachefs/snapshot.h:41:9, inlined from 'bch2_snapshot_is_internal_node' at fs/bcachefs/snapshot.h:142:6, inlined from 'bch2_snapshot_is_leaf' at fs/bcachefs/snapshot.h:151:10, inlined from 'check_pos_snapshot_overwritten' at fs/bcachefs/btree_update.c:70:6, inlined from 'extent_back_merge' at fs/bcachefs/btree_update.c:117:10: >> fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] 36 | return &t->s[U32_MAX - id]; | ~~~~^~~~~~~~~~~~~~ fs/bcachefs/subvolume_types.h: In function 'extent_back_merge': fs/bcachefs/subvolume_types.h:23:33: note: while referencing 's' 23 | struct snapshot_t s[0]; | ^ In function '__snapshot_t', inlined from 'snapshot_t' at fs/bcachefs/snapshot.h:41:9, inlined from 'bch2_snapshot_is_internal_node' at fs/bcachefs/snapshot.h:142:6, inlined from 'bch2_snapshot_is_leaf' at fs/bcachefs/snapshot.h:151:10, inlined from 'check_pos_snapshot_overwritten' at fs/bcachefs/btree_update.c:70:6, inlined from 'extent_back_merge' at fs/bcachefs/btree_update.c:118:3: >> fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] 36 | return &t->s[U32_MAX - id]; | ~~~~^~~~~~~~~~~~~~ fs/bcachefs/subvolume_types.h: In function 'extent_back_merge': fs/bcachefs/subvolume_types.h:23:33: note: while referencing 's' 23 | struct snapshot_t s[0]; | ^ In function '__snapshot_t', inlined from 'snapshot_t' at fs/bcachefs/snapshot.h:41:9, inlined from 'bch2_snapshot_is_internal_node' at fs/bcachefs/snapshot.h:142:6, inlined from 'bch2_snapshot_is_leaf' at fs/bcachefs/snapshot.h:151:10, inlined from 'check_pos_snapshot_overwritten' at fs/bcachefs/btree_update.c:70:6, inlined from 'extent_front_merge' at fs/bcachefs/btree_update.c:94:10: >> fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] 36 | return &t->s[U32_MAX - id]; | ~~~~^~~~~~~~~~~~~~ fs/bcachefs/subvolume_types.h: In function 'extent_front_merge': fs/bcachefs/subvolume_types.h:23:33: note: while referencing 's' 23 | struct snapshot_t s[0]; | ^ In function '__snapshot_t', inlined from 'snapshot_t' at fs/bcachefs/snapshot.h:41:9, inlined from 'bch2_snapshot_is_internal_node' at fs/bcachefs/snapshot.h:142:6, inlined from 'bch2_snapshot_is_leaf' at fs/bcachefs/snapshot.h:151:10, inlined from 'check_pos_snapshot_overwritten' at fs/bcachefs/btree_update.c:70:6, inlined from 'extent_front_merge' at fs/bcachefs/btree_update.c:95:3: >> fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] 36 | return &t->s[U32_MAX - id]; | ~~~~^~~~~~~~~~~~~~ fs/bcachefs/subvolume_types.h: In function 'extent_front_merge': fs/bcachefs/subvolume_types.h:23:33: note: while referencing 's' 23 | struct snapshot_t s[0]; | ^ In function '__snapshot_t', inlined from 'snapshot_t' at fs/bcachefs/snapshot.h:41:9, inlined from 'bch2_snapshot_has_children' at fs/bcachefs/snapshot.h:196:6, inlined from '__bch2_insert_snapshot_whiteouts' at fs/bcachefs/btree_update.c:174:7: >> fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] 36 | return &t->s[U32_MAX - id]; | ~~~~^~~~~~~~~~~~~~ fs/bcachefs/subvolume_types.h: In function '__bch2_insert_snapshot_whiteouts': fs/bcachefs/subvolume_types.h:23:33: note: while referencing 's' 23 | struct snapshot_t s[0]; | ^ In function '__snapshot_t', inlined from 'snapshot_t' at fs/bcachefs/snapshot.h:41:9, inlined from 'bch2_snapshot_has_children' at fs/bcachefs/snapshot.h:196:6, inlined from '__bch2_insert_snapshot_whiteouts' at fs/bcachefs/btree_update.c:174:7: >> fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] 36 | return &t->s[U32_MAX - id]; | ~~~~^~~~~~~~~~~~~~ fs/bcachefs/subvolume_types.h: In function '__bch2_insert_snapshot_whiteouts': fs/bcachefs/subvolume_types.h:23:33: note: while referencing 's' 23 | struct snapshot_t s[0]; | ^ .. vim +36 fs/bcachefs/snapshot.h 33 34 static inline struct snapshot_t *__snapshot_t(struct snapshot_table *t, u32 id) 35 { > 36 return &t->s[U32_MAX - id]; 37 } 38 39 static inline const struct snapshot_t *snapshot_t(struct bch_fs *c, u32 id) 40 { > 41 return __snapshot_t(rcu_dereference(c->snapshots), id); 42 } 43 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki