]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blobdiff - fs/btrfs/volumes.c
btrfs: check rw_devices, not num_devices for balance
[mirror_ubuntu-eoan-kernel.git] / fs / btrfs / volumes.c
index 6267d88aaad6e22cdfaa3c91569eeb072cfbdba1..94cf3c789e5ec8f65a5918e5f04c2d3d540cc592 100644 (file)
@@ -4075,7 +4075,11 @@ int btrfs_balance(struct btrfs_fs_info *fs_info,
                }
        }
 
-       num_devices = btrfs_num_devices(fs_info);
+       /*
+        * rw_devices will not change at the moment, device add/delete/replace
+        * are excluded by EXCL_OP
+        */
+       num_devices = fs_info->fs_devices->rw_devices;
 
        /*
         * SINGLE profile on-disk has no profile bit, but in-memory we have a