]> git.sur5r.net Git - u-boot/blobdiff - fs/btrfs/chunk-map.c
fs: btrfs: Fix not all CHUNK_ITEMs being read from CHUNK_TREE
[u-boot] / fs / btrfs / chunk-map.c
index 48407f33316f68d8c63578683b9226a372306f33..beb6a4bb928e79819a529fb1c611a421bc7ae38b 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * BTRFS filesystem implementation for U-Boot
  *
  * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include "btrfs.h"
@@ -147,7 +146,7 @@ int btrfs_read_chunk_tree(void)
        struct btrfs_path path;
        struct btrfs_key key, *found_key;
        struct btrfs_chunk *chunk;
-       int res;
+       int res = 0;
 
        key.objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID;
        key.type = BTRFS_CHUNK_ITEM_KEY;
@@ -159,7 +158,7 @@ int btrfs_read_chunk_tree(void)
        do {
                found_key = btrfs_path_leaf_key(&path);
                if (btrfs_comp_keys_type(&key, found_key))
-                       break;
+                       continue;
 
                chunk = btrfs_path_item_ptr(&path, struct btrfs_chunk);
                btrfs_chunk_to_cpu(chunk);