Skip to content

Commit 74c7cc7

Browse files
committed
Merge tag 'for-6.17-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull btrfs fix from David Sterba: "One more regression fix for a problem in zoned mode: mounting would fail if the number of open and active zones reached a common limit that didn't use to be checked" * tag 'for-6.17-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: zoned: don't fail mount needlessly due to too many active zones
2 parents fd7d927 + 53de7ee commit 74c7cc7

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

fs/btrfs/zoned.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
514514

515515
if (max_active_zones) {
516516
if (nactive > max_active_zones) {
517+
if (bdev_max_active_zones(bdev) == 0) {
518+
max_active_zones = 0;
519+
zone_info->max_active_zones = 0;
520+
goto validate;
521+
}
517522
btrfs_err(device->fs_info,
518523
"zoned: %u active zones on %s exceeds max_active_zones %u",
519524
nactive, rcu_dereference(device->name),
@@ -526,6 +531,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
526531
set_bit(BTRFS_FS_ACTIVE_ZONE_TRACKING, &fs_info->flags);
527532
}
528533

534+
validate:
529535
/* Validate superblock log */
530536
nr_zones = BTRFS_NR_SB_LOG_ZONES;
531537
for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {

0 commit comments

Comments
 (0)