diff --git a/libntfs-3g/lcnalloc.c b/libntfs-3g/lcnalloc.c index 073141d0..75f8b6ab 100644 --- a/libntfs-3g/lcnalloc.c +++ b/libntfs-3g/lcnalloc.c @@ -51,7 +51,7 @@ * the update of the mapping pairs which converges to the cubic Faulhaber's * formula as the function of the number of extents (fragments, runs). */ -#define NTFS_LCNALLOC_BSIZE 8192 +#define NTFS_LCNALLOC_BSIZE 4096 #define NTFS_LCNALLOC_SKIP NTFS_LCNALLOC_BSIZE static void ntfs_cluster_set_zone_pos(LCN start, LCN end, LCN *pos, LCN tc) @@ -89,6 +89,11 @@ static s64 max_empty_bit_range(unsigned char *buf, int size) for (i = 0; i < size; i++, buf++) { + if (*buf == 0) { + run += 8; + continue; + } + for (j = 0; j < 8; j++) { int bit = *buf & (1 << j);