Btrfs: stop refusing the relocation of chunk 0
[firefly-linux-kernel-4.4.55.git] / fs / btrfs / volumes.c
index f42e412901249f1a01b94af9a7f0f3d17a57556c..603cce85764f2587ef07a468989256b229ce160c 100644 (file)
@@ -2997,10 +2997,6 @@ again:
                if (found_key.objectid != key.objectid)
                        break;
 
-               /* chunk zero is special */
-               if (found_key.offset == 0)
-                       break;
-
                chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk);
 
                if (!counting) {
@@ -3036,6 +3032,8 @@ again:
                        spin_unlock(&fs_info->balance_lock);
                }
 loop:
+               if (found_key.offset == 0)
+                       break;
                key.offset = found_key.offset - 1;
        }