tree:
https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git zoned
head: 9560b14e9901073c5fca5e5e6c531dbd950b2b04
commit: 366b493dd533a7de96f719c30d452ea745233836 [2/3] bcache: handle zone management bios
for bcache device
config: arm-randconfig-r004-20200524 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
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
git checkout 366b493dd533a7de96f719c30d452ea745233836
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
drivers/md/bcache/request.c: In function 'bch_data_invalidate_zones':
> drivers/md/bcache/request.c:1072:8: warning: 'free_keys'
is used uninitialized in this function [-Wuninitialized]
1072 | ret =
bch_keylist_realloc(&iop->insert_keys, free_keys, iop->c);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/free_keys +1072 drivers/md/bcache/request.c
1054
1055 /*
1056 * Invalidate the LBA range on cache device which is covered by the
1057 * the resetting zones.
1058 */
1059 static int bch_data_invalidate_zones(struct closure *cl,
1060 size_t zone_sector,
1061 size_t nr_zones)
1062 {
1063 struct search *s = container_of(cl, struct search, cl);
1064 struct data_insert_op *iop = &s->iop;
1065 int max_keys, free_keys;
1066 size_t start = zone_sector;
1067 int ret;
1068
1069 max_keys = (block_bytes(iop->c) - sizeof(struct jset)) /
1070 sizeof(uint64_t);
1071 bch_keylist_init(&iop->insert_keys);
1072 ret = bch_keylist_realloc(&iop->insert_keys, free_keys,
iop->c);
1073 if (ret < 0)
1074 return -ENOMEM;
1075
1076 while (nr_zones-- > 0) {
1077 atomic_t *journal_ref = NULL;
1078 size_t size = s->d->disk->queue->limits.chunk_sectors;
1079 more_keys:
1080 bch_keylist_reset(&iop->insert_keys);
1081 free_keys = max_keys;
1082
1083 while (size > 0 && free_keys >= 2) {
1084 size_t sectors = min_t(size_t, size,
1085 1U << (KEY_SIZE_BITS - 1));
1086
1087 bch_keylist_add(&iop->insert_keys,
1088 &KEY(iop->inode, start, sectors));
1089 start += sectors;
1090 size -= sectors;
1091 free_keys -= 2;
1092 }
1093
1094 /* Insert invalidate keys into btree */
1095 journal_ref = bch_journal(iop->c, &iop->insert_keys, NULL);
1096 if (!journal_ref) {
1097 ret = -EIO;
1098 break;
1099 }
1100
1101 ret = bch_btree_insert(iop->c,
1102 &iop->insert_keys, journal_ref, NULL);
1103 atomic_dec_bug(journal_ref);
1104 if (ret < 0)
1105 break;
1106
1107 if (size)
1108 goto more_keys;
1109 }
1110
1111 bch_keylist_free(&iop->insert_keys);
1112
1113 return ret;
1114 }
1115
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org