[bug report] btrfs: tests: zoned: add tests cases for zoned code

From: Dan Carpenter

Date: Tue Feb 10 2026 - 03:43:48 EST


[ Smatch checking is paused while we raise funding. #SadFace
https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ]
Hello Naohiro Aota,

Commit df321b214f62 ("btrfs: tests: zoned: add tests cases for zoned
code") from Feb 4, 2026 (linux-next), leads to the following Smatch
static checker warning:

fs/btrfs/tests/zoned-tests.c:68 test_load_zone_info()
warn: duplicate check 'zone_info' (previous on line 62)

fs/btrfs/tests/zoned-tests.c
40 static int test_load_zone_info(struct btrfs_fs_info *fs_info,
41 const struct load_zone_info_test_vector *test)
42 {
43 struct btrfs_block_group *bg __free(btrfs_free_dummy_block_group) = NULL;
44 struct btrfs_chunk_map *map __free(btrfs_free_chunk_map) = NULL;
45 struct zone_info AUTO_KFREE(zone_info);
46 unsigned long AUTO_KFREE(active);
47 int ret;
48
49 bg = btrfs_alloc_dummy_block_group(fs_info, test->bg_length);
50 if (!bg) {
51 test_std_err(TEST_ALLOC_BLOCK_GROUP);
52 return -ENOMEM;
53 }
54
55 map = btrfs_alloc_chunk_map(test->num_stripes, GFP_KERNEL);
56 if (!map) {
57 test_std_err(TEST_ALLOC_EXTENT_MAP);
58 return -ENOMEM;
59 }
60
61 zone_info = kcalloc(test->num_stripes, sizeof(*zone_info), GFP_KERNEL);
62 if (!zone_info) {
63 test_err("cannot allocate zone info");
64 return -ENOMEM;
65 }
66
67 active = bitmap_zalloc(test->num_stripes, GFP_KERNEL);
--> 68 if (!zone_info) {

s/zone_info/active/

69 test_err("cannot allocate active bitmap");
70 return -ENOMEM;
71 }
72

regards,
dan carpenter