This is needed to enable device add to work in cases when a file system
has been mounted with 'skip_balance' mount option.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  *
  * Compatibility:
  * - the same type is already running
+ * - when trying to add a device and balance has been paused
  * - not BTRFS_EXCLOP_NONE - this is intentionally incompatible and the caller
  *   must check the condition first that would allow none -> @type
  */
                                 enum btrfs_exclusive_operation type)
 {
        spin_lock(&fs_info->super_lock);
-       if (fs_info->exclusive_operation == type)
+       if (fs_info->exclusive_operation == type ||
+           (fs_info->exclusive_operation == BTRFS_EXCLOP_BALANCE_PAUSED &&
+            type == BTRFS_EXCLOP_DEV_ADD))
                return true;
 
        spin_unlock(&fs_info->super_lock);