* [sashal-stable:pending-5.10 16/26] fs/btrfs/tree-checker.c:950:46: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const struct btrfs_item *'
@ 2022-02-17 23:01 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-02-17 23:01 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 4053 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git pending-5.10
head: c7460074320c38fd9956dc1923fd4ccfdb7437b0
commit: 1f509454ef33a91f39e90978ef9be20e03003194 [16/26] btrfs: tree-checker: check item_size for dev_item
config: hexagon-randconfig-r041-20220217 (https://download.01.org/0day-ci/archive/20220218/202202180659.yW48k7qq-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/commit/?id=1f509454ef33a91f39e90978ef9be20e03003194
git remote add sashal-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-stable pending-5.10
git checkout 1f509454ef33a91f39e90978ef9be20e03003194
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash fs/btrfs/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> fs/btrfs/tree-checker.c:950:46: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const struct btrfs_item *' [-Wint-conversion]
const u32 item_size = btrfs_item_size(leaf, slot);
^~~~
fs/btrfs/ctree.h:1833:1: note: passing argument to parameter 's' here
BTRFS_SETGET_FUNCS(item_size, struct btrfs_item, size, 32);
^
fs/btrfs/ctree.h:1474:20: note: expanded from macro 'BTRFS_SETGET_FUNCS'
const type *s) \
^
1 warning generated.
vim +950 fs/btrfs/tree-checker.c
945
946 static int check_dev_item(struct extent_buffer *leaf,
947 struct btrfs_key *key, int slot)
948 {
949 struct btrfs_dev_item *ditem;
> 950 const u32 item_size = btrfs_item_size(leaf, slot);
951
952 if (key->objectid != BTRFS_DEV_ITEMS_OBJECTID) {
953 dev_item_err(leaf, slot,
954 "invalid objectid: has=%llu expect=%llu",
955 key->objectid, BTRFS_DEV_ITEMS_OBJECTID);
956 return -EUCLEAN;
957 }
958
959 if (unlikely(item_size != sizeof(*ditem))) {
960 dev_item_err(leaf, slot, "invalid item size: has %u expect %zu",
961 item_size, sizeof(*ditem));
962 return -EUCLEAN;
963 }
964
965 ditem = btrfs_item_ptr(leaf, slot, struct btrfs_dev_item);
966 if (btrfs_device_id(leaf, ditem) != key->offset) {
967 dev_item_err(leaf, slot,
968 "devid mismatch: key has=%llu item has=%llu",
969 key->offset, btrfs_device_id(leaf, ditem));
970 return -EUCLEAN;
971 }
972
973 /*
974 * For device total_bytes, we don't have reliable way to check it, as
975 * it can be 0 for device removal. Device size check can only be done
976 * by dev extents check.
977 */
978 if (btrfs_device_bytes_used(leaf, ditem) >
979 btrfs_device_total_bytes(leaf, ditem)) {
980 dev_item_err(leaf, slot,
981 "invalid bytes used: have %llu expect [0, %llu]",
982 btrfs_device_bytes_used(leaf, ditem),
983 btrfs_device_total_bytes(leaf, ditem));
984 return -EUCLEAN;
985 }
986 /*
987 * Remaining members like io_align/type/gen/dev_group aren't really
988 * utilized. Skip them to make later usage of them easier.
989 */
990 return 0;
991 }
992
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-02-17 23:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17 23:01 [sashal-stable:pending-5.10 16/26] fs/btrfs/tree-checker.c:950:46: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const struct btrfs_item *' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.