From fcba4d92e7a78feb263f8ee0374ec5277341cdd3 Mon Sep 17 00:00:00 2001 From: relan Date: Sat, 11 Jul 2015 13:04:51 +0300 Subject: [PATCH] Turn "FS is larger than device" error into warning. After formatting a memory card in a Panasonic Lumix DMC TZ-40 camera the FS appears to be 512 bytes larger than underlying device size. This makes the last cluster unaccessible. Not a big deal. --- libexfat/mount.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libexfat/mount.c b/libexfat/mount.c index 6e7881c..7ccdd4e 100644 --- a/libexfat/mount.c +++ b/libexfat/mount.c @@ -253,14 +253,12 @@ int exfat_mount(struct exfat* ef, const char* spec, const char* options) if (le64_to_cpu(ef->sb->sector_count) * SECTOR_SIZE(*ef->sb) > exfat_get_size(ef->dev)) { - free(ef->zero_cluster); - exfat_error("file system is larger than underlying device: " + /* this can cause I/O errors later but we don't fail mounting to let + user rescue data */ + exfat_warn("file system is larger than underlying device: " "%"PRIu64" > %"PRIu64, le64_to_cpu(ef->sb->sector_count) * SECTOR_SIZE(*ef->sb), exfat_get_size(ef->dev)); - exfat_close(ef->dev); - free(ef->sb); - return -EIO; } ef->root = malloc(sizeof(struct exfat_node)); -- 2.11.0