OSDN Git Service

Fix clusters bitmap size.
authorrelan <relan@users.noreply.github.com>
Tue, 2 May 2017 17:19:57 +0000 (20:19 +0300)
committerrelan <relan@users.noreply.github.com>
Tue, 2 May 2017 17:19:57 +0000 (20:19 +0300)
The last two clusters were erroneously considered invalid. Note that
clusters numbering starts with 2.

libexfat/node.c

index 3f58e9d..b544bd9 100644 (file)
@@ -469,8 +469,7 @@ static int readdir(struct exfat* ef, struct exfat_node* parent,
                                                ef->cmap.start_cluster);
                                return -EIO;
                        }
-                       ef->cmap.size = le32_to_cpu(ef->sb->cluster_count) -
-                               EXFAT_FIRST_DATA_CLUSTER;
+                       ef->cmap.size = le32_to_cpu(ef->sb->cluster_count);
                        if (le64_to_cpu(bitmap->size) < DIV_ROUND_UP(ef->cmap.size, 8))
                        {
                                exfat_error("invalid clusters bitmap size: %"PRIu64