From: relan Date: Tue, 2 May 2017 17:19:57 +0000 (+0300) Subject: Fix clusters bitmap size. X-Git-Tag: android-x86-9.0-r1~42 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2f6a54823b8069e9f02b5ece1e6b77307f808283;p=android-x86%2Fexternal-exfat.git Fix clusters bitmap size. The last two clusters were erroneously considered invalid. Note that clusters numbering starts with 2. --- diff --git a/libexfat/node.c b/libexfat/node.c index 3f58e9d..b544bd9 100644 --- a/libexfat/node.c +++ b/libexfat/node.c @@ -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