Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2AF381381 for ; Wed, 22 Nov 2023 00:56:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SCglno63" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700614565; x=1732150565; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=fSpeD5iFqDHuKexD1pKH9qFj56tGsLKudzzYozYnIEE=; b=SCglno635YrJFqMgtptr52cNQcebaoYnqBxc20YW/MJnhfrIAREL9GZV A3uG/4JU2GvO5ECAcAP3XaDO7Vzy2tkY5Nji8bv6OogSq3MNI/9uj8JP9 F8Ls+jRoDlPDX8JkZQWnWvIjmPLNWRKz3j0pgl4tJKqYN1875wn/LF4CQ RRATEIRQq1wFmr5THWFqTKbNIf2noNBvbHfHTxgCpr0ubDv5Rd8aF7G9+ xl80v08hXLZ24XKKwyk97Vq5nZSgySSqYtA5MnDGhK/PTqiyxXf3WtEZD Vysy2JxasdaGrYtOzDLfyGcZu6flNCFrCnnTAxsH0q0onBMVXKKmFvfR/ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="395873796" X-IronPort-AV: E=Sophos;i="6.04,217,1695711600"; d="scan'208";a="395873796" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2023 16:56:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="910623922" X-IronPort-AV: E=Sophos;i="6.04,217,1695711600"; d="scan'208";a="910623922" Received: from lkp-server02.sh.intel.com (HELO b8de5498638e) ([10.239.97.151]) by fmsmga001.fm.intel.com with ESMTP; 21 Nov 2023 16:56:02 -0800 Received: from kbuild by b8de5498638e with local (Exim 4.96) (envelope-from ) id 1r5bX6-0008TC-0y; Wed, 22 Nov 2023 00:56:00 +0000 Date: Wed, 22 Nov 2023 08:55:00 +0800 From: kernel test robot To: fdmanana@kernel.org Cc: oe-kbuild-all@lists.linux.dev Subject: Re: [PATCH 7/8] btrfs: use a dedicated data structure for chunk maps Message-ID: <202311220822.OpLBXrUy-lkp@intel.com> References: <777320fd09dfc68a89180723bf5d7368dab06299.1700573314.git.fdmanana@suse.com> Precedence: bulk X-Mailing-List: oe-kbuild-all@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <777320fd09dfc68a89180723bf5d7368dab06299.1700573314.git.fdmanana@suse.com> Hi, kernel test robot noticed the following build errors: [auto build test ERROR on kdave/for-next] [also build test ERROR on linus/master v6.7-rc2 next-20231121] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/fdmanana-kernel-org/btrfs-fix-off-by-one-when-checking-chunk-map-includes-logical-address/20231121-214139 base: https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next patch link: https://lore.kernel.org/r/777320fd09dfc68a89180723bf5d7368dab06299.1700573314.git.fdmanana%40suse.com patch subject: [PATCH 7/8] btrfs: use a dedicated data structure for chunk maps config: x86_64-randconfig-121-20231122 (https://download.01.org/0day-ci/archive/20231122/202311220822.OpLBXrUy-lkp@intel.com/config) compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231122/202311220822.OpLBXrUy-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/202311220822.OpLBXrUy-lkp@intel.com/ All error/warnings (new ones prefixed by >>): >> fs/btrfs/zoned.c:1293:12: warning: 'struct map_lookup' declared inside parameter list will not be visible outside of this definition or declaration struct map_lookup *map) ^~~~~~~~~~ fs/btrfs/zoned.c: In function 'btrfs_load_zone_info': >> fs/btrfs/zoned.c:1296:35: error: dereferencing pointer to incomplete type 'struct map_lookup' struct btrfs_device *device = map->stripes[zone_idx].dev; ^~ fs/btrfs/zoned.c: At top level: fs/btrfs/zoned.c:1396:18: warning: 'struct map_lookup' declared inside parameter list will not be visible outside of this definition or declaration struct map_lookup *map, ^~~~~~~~~~ fs/btrfs/zoned.c: In function 'btrfs_load_block_group_dup': fs/btrfs/zoned.c:1402:10: error: dereferencing pointer to incomplete type 'struct map_lookup' if ((map->type & BTRFS_BLOCK_GROUP_DATA) && !fs_info->stripe_root) { ^~ fs/btrfs/zoned.c: At top level: fs/btrfs/zoned.c:1438:13: warning: 'struct map_lookup' declared inside parameter list will not be visible outside of this definition or declaration struct map_lookup *map, ^~~~~~~~~~ fs/btrfs/zoned.c: In function 'btrfs_load_block_group_raid1': fs/btrfs/zoned.c:1445:10: error: dereferencing pointer to incomplete type 'struct map_lookup' if ((map->type & BTRFS_BLOCK_GROUP_DATA) && !fs_info->stripe_root) { ^~ fs/btrfs/zoned.c: At top level: fs/btrfs/zoned.c:1486:13: warning: 'struct map_lookup' declared inside parameter list will not be visible outside of this definition or declaration struct map_lookup *map, ^~~~~~~~~~ fs/btrfs/zoned.c: In function 'btrfs_load_block_group_raid0': fs/btrfs/zoned.c:1492:10: error: dereferencing pointer to incomplete type 'struct map_lookup' if ((map->type & BTRFS_BLOCK_GROUP_DATA) && !fs_info->stripe_root) { ^~ fs/btrfs/zoned.c: At top level: fs/btrfs/zoned.c:1518:14: warning: 'struct map_lookup' declared inside parameter list will not be visible outside of this definition or declaration struct map_lookup *map, ^~~~~~~~~~ fs/btrfs/zoned.c: In function 'btrfs_load_block_group_raid10': fs/btrfs/zoned.c:1524:10: error: dereferencing pointer to incomplete type 'struct map_lookup' if ((map->type & BTRFS_BLOCK_GROUP_DATA) && !fs_info->stripe_root) { ^~ fs/btrfs/zoned.c: In function 'btrfs_load_block_group_zone_info': >> fs/btrfs/zoned.c:1555:36: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] struct extent_map_tree *em_tree = &fs_info->mapping_tree; ^ >> fs/btrfs/zoned.c:1600:65: error: passing argument 5 of 'btrfs_load_zone_info' from incompatible pointer type [-Werror=incompatible-pointer-types] ret = btrfs_load_zone_info(fs_info, i, &zone_info[i], active, map); ^~~ fs/btrfs/zoned.c:1291:12: note: expected 'struct map_lookup *' but argument is of type 'struct btrfs_chunk_map *' static int btrfs_load_zone_info(struct btrfs_fs_info *fs_info, int zone_idx, ^~~~~~~~~~~~~~~~~~~~ >> fs/btrfs/zoned.c:1634:43: error: passing argument 2 of 'btrfs_load_block_group_dup' from incompatible pointer type [-Werror=incompatible-pointer-types] ret = btrfs_load_block_group_dup(cache, map, zone_info, active); ^~~ fs/btrfs/zoned.c:1395:12: note: expected 'struct map_lookup *' but argument is of type 'struct btrfs_chunk_map *' static int btrfs_load_block_group_dup(struct btrfs_block_group *bg, ^~~~~~~~~~~~~~~~~~~~~~~~~~ >> fs/btrfs/zoned.c:1639:45: error: passing argument 2 of 'btrfs_load_block_group_raid1' from incompatible pointer type [-Werror=incompatible-pointer-types] ret = btrfs_load_block_group_raid1(cache, map, zone_info, active); ^~~ fs/btrfs/zoned.c:1437:12: note: expected 'struct map_lookup *' but argument is of type 'struct btrfs_chunk_map *' static int btrfs_load_block_group_raid1(struct btrfs_block_group *bg, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> fs/btrfs/zoned.c:1642:45: error: passing argument 2 of 'btrfs_load_block_group_raid0' from incompatible pointer type [-Werror=incompatible-pointer-types] ret = btrfs_load_block_group_raid0(cache, map, zone_info, active); ^~~ fs/btrfs/zoned.c:1485:12: note: expected 'struct map_lookup *' but argument is of type 'struct btrfs_chunk_map *' static int btrfs_load_block_group_raid0(struct btrfs_block_group *bg, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> fs/btrfs/zoned.c:1645:46: error: passing argument 2 of 'btrfs_load_block_group_raid10' from incompatible pointer type [-Werror=incompatible-pointer-types] ret = btrfs_load_block_group_raid10(cache, map, zone_info, active); ^~~ fs/btrfs/zoned.c:1517:12: note: expected 'struct map_lookup *' but argument is of type 'struct btrfs_chunk_map *' static int btrfs_load_block_group_raid10(struct btrfs_block_group *bg, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> fs/btrfs/zoned.c:1555:26: warning: unused variable 'em_tree' [-Wunused-variable] struct extent_map_tree *em_tree = &fs_info->mapping_tree; ^~~~~~~ cc1: some warnings being treated as errors vim +1296 fs/btrfs/zoned.c 15c12fcc50a1b1 Christoph Hellwig 2023-06-05 1290 09a46725cc8416 Christoph Hellwig 2023-06-05 1291 static int btrfs_load_zone_info(struct btrfs_fs_info *fs_info, int zone_idx, 09a46725cc8416 Christoph Hellwig 2023-06-05 1292 struct zone_info *info, unsigned long *active, 09a46725cc8416 Christoph Hellwig 2023-06-05 @1293 struct map_lookup *map) 09a46725cc8416 Christoph Hellwig 2023-06-05 1294 { 09a46725cc8416 Christoph Hellwig 2023-06-05 1295 struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace; 09a46725cc8416 Christoph Hellwig 2023-06-05 @1296 struct btrfs_device *device = map->stripes[zone_idx].dev; 09a46725cc8416 Christoph Hellwig 2023-06-05 1297 int dev_replace_is_ongoing = 0; 09a46725cc8416 Christoph Hellwig 2023-06-05 1298 unsigned int nofs_flag; 09a46725cc8416 Christoph Hellwig 2023-06-05 1299 struct blk_zone zone; 09a46725cc8416 Christoph Hellwig 2023-06-05 1300 int ret; 09a46725cc8416 Christoph Hellwig 2023-06-05 1301 09a46725cc8416 Christoph Hellwig 2023-06-05 1302 info->physical = map->stripes[zone_idx].physical; 09a46725cc8416 Christoph Hellwig 2023-06-05 1303 09a46725cc8416 Christoph Hellwig 2023-06-05 1304 if (!device->bdev) { 09a46725cc8416 Christoph Hellwig 2023-06-05 1305 info->alloc_offset = WP_MISSING_DEV; 09a46725cc8416 Christoph Hellwig 2023-06-05 1306 return 0; 09a46725cc8416 Christoph Hellwig 2023-06-05 1307 } 09a46725cc8416 Christoph Hellwig 2023-06-05 1308 09a46725cc8416 Christoph Hellwig 2023-06-05 1309 /* Consider a zone as active if we can allow any number of active zones. */ 09a46725cc8416 Christoph Hellwig 2023-06-05 1310 if (!device->zone_info->max_active_zones) 09a46725cc8416 Christoph Hellwig 2023-06-05 1311 __set_bit(zone_idx, active); 09a46725cc8416 Christoph Hellwig 2023-06-05 1312 09a46725cc8416 Christoph Hellwig 2023-06-05 1313 if (!btrfs_dev_is_sequential(device, info->physical)) { 09a46725cc8416 Christoph Hellwig 2023-06-05 1314 info->alloc_offset = WP_CONVENTIONAL; 09a46725cc8416 Christoph Hellwig 2023-06-05 1315 return 0; 09a46725cc8416 Christoph Hellwig 2023-06-05 1316 } 09a46725cc8416 Christoph Hellwig 2023-06-05 1317 09a46725cc8416 Christoph Hellwig 2023-06-05 1318 /* This zone will be used for allocation, so mark this zone non-empty. */ 09a46725cc8416 Christoph Hellwig 2023-06-05 1319 btrfs_dev_clear_zone_empty(device, info->physical); 09a46725cc8416 Christoph Hellwig 2023-06-05 1320 09a46725cc8416 Christoph Hellwig 2023-06-05 1321 down_read(&dev_replace->rwsem); 09a46725cc8416 Christoph Hellwig 2023-06-05 1322 dev_replace_is_ongoing = btrfs_dev_replace_is_ongoing(dev_replace); 09a46725cc8416 Christoph Hellwig 2023-06-05 1323 if (dev_replace_is_ongoing && dev_replace->tgtdev != NULL) 09a46725cc8416 Christoph Hellwig 2023-06-05 1324 btrfs_dev_clear_zone_empty(dev_replace->tgtdev, info->physical); 09a46725cc8416 Christoph Hellwig 2023-06-05 1325 up_read(&dev_replace->rwsem); 09a46725cc8416 Christoph Hellwig 2023-06-05 1326 09a46725cc8416 Christoph Hellwig 2023-06-05 1327 /* 09a46725cc8416 Christoph Hellwig 2023-06-05 1328 * The group is mapped to a sequential zone. Get the zone write pointer 09a46725cc8416 Christoph Hellwig 2023-06-05 1329 * to determine the allocation offset within the zone. 09a46725cc8416 Christoph Hellwig 2023-06-05 1330 */ 09a46725cc8416 Christoph Hellwig 2023-06-05 1331 WARN_ON(!IS_ALIGNED(info->physical, fs_info->zone_size)); 09a46725cc8416 Christoph Hellwig 2023-06-05 1332 nofs_flag = memalloc_nofs_save(); 09a46725cc8416 Christoph Hellwig 2023-06-05 1333 ret = btrfs_get_dev_zone(device, info->physical, &zone); 09a46725cc8416 Christoph Hellwig 2023-06-05 1334 memalloc_nofs_restore(nofs_flag); 09a46725cc8416 Christoph Hellwig 2023-06-05 1335 if (ret) { 09a46725cc8416 Christoph Hellwig 2023-06-05 1336 if (ret != -EIO && ret != -EOPNOTSUPP) 09a46725cc8416 Christoph Hellwig 2023-06-05 1337 return ret; 09a46725cc8416 Christoph Hellwig 2023-06-05 1338 info->alloc_offset = WP_MISSING_DEV; 09a46725cc8416 Christoph Hellwig 2023-06-05 1339 return 0; 09a46725cc8416 Christoph Hellwig 2023-06-05 1340 } 09a46725cc8416 Christoph Hellwig 2023-06-05 1341 09a46725cc8416 Christoph Hellwig 2023-06-05 1342 if (zone.type == BLK_ZONE_TYPE_CONVENTIONAL) { 09a46725cc8416 Christoph Hellwig 2023-06-05 1343 btrfs_err_in_rcu(fs_info, 09a46725cc8416 Christoph Hellwig 2023-06-05 1344 "zoned: unexpected conventional zone %llu on device %s (devid %llu)", 09a46725cc8416 Christoph Hellwig 2023-06-05 1345 zone.start << SECTOR_SHIFT, rcu_str_deref(device->name), 09a46725cc8416 Christoph Hellwig 2023-06-05 1346 device->devid); 09a46725cc8416 Christoph Hellwig 2023-06-05 1347 return -EIO; 09a46725cc8416 Christoph Hellwig 2023-06-05 1348 } 09a46725cc8416 Christoph Hellwig 2023-06-05 1349 09a46725cc8416 Christoph Hellwig 2023-06-05 1350 info->capacity = (zone.capacity << SECTOR_SHIFT); 09a46725cc8416 Christoph Hellwig 2023-06-05 1351 09a46725cc8416 Christoph Hellwig 2023-06-05 1352 switch (zone.cond) { 09a46725cc8416 Christoph Hellwig 2023-06-05 1353 case BLK_ZONE_COND_OFFLINE: 09a46725cc8416 Christoph Hellwig 2023-06-05 1354 case BLK_ZONE_COND_READONLY: 09a46725cc8416 Christoph Hellwig 2023-06-05 1355 btrfs_err(fs_info, 09a46725cc8416 Christoph Hellwig 2023-06-05 1356 "zoned: offline/readonly zone %llu on device %s (devid %llu)", 09a46725cc8416 Christoph Hellwig 2023-06-05 1357 (info->physical >> device->zone_info->zone_size_shift), 09a46725cc8416 Christoph Hellwig 2023-06-05 1358 rcu_str_deref(device->name), device->devid); 09a46725cc8416 Christoph Hellwig 2023-06-05 1359 info->alloc_offset = WP_MISSING_DEV; 09a46725cc8416 Christoph Hellwig 2023-06-05 1360 break; 09a46725cc8416 Christoph Hellwig 2023-06-05 1361 case BLK_ZONE_COND_EMPTY: 09a46725cc8416 Christoph Hellwig 2023-06-05 1362 info->alloc_offset = 0; 09a46725cc8416 Christoph Hellwig 2023-06-05 1363 break; 09a46725cc8416 Christoph Hellwig 2023-06-05 1364 case BLK_ZONE_COND_FULL: 09a46725cc8416 Christoph Hellwig 2023-06-05 1365 info->alloc_offset = info->capacity; 09a46725cc8416 Christoph Hellwig 2023-06-05 1366 break; 09a46725cc8416 Christoph Hellwig 2023-06-05 1367 default: 09a46725cc8416 Christoph Hellwig 2023-06-05 1368 /* Partially used zone. */ 09a46725cc8416 Christoph Hellwig 2023-06-05 1369 info->alloc_offset = ((zone.wp - zone.start) << SECTOR_SHIFT); 09a46725cc8416 Christoph Hellwig 2023-06-05 1370 __set_bit(zone_idx, active); 09a46725cc8416 Christoph Hellwig 2023-06-05 1371 break; 09a46725cc8416 Christoph Hellwig 2023-06-05 1372 } 09a46725cc8416 Christoph Hellwig 2023-06-05 1373 09a46725cc8416 Christoph Hellwig 2023-06-05 1374 return 0; 09a46725cc8416 Christoph Hellwig 2023-06-05 1375 } 09a46725cc8416 Christoph Hellwig 2023-06-05 1376 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki