fix: multi-block allocation could allocate or free used blocks in certain
rare circumstances. Because FUSE write(2) size was restricted to 4 KB until recently and the most widely used NTFS block size is also 4 KB thus allocations were typically single block size therefore the bug wasn't visible and couldn't be easily reproduced. However MFT allocations are multi-block size and they could lead to data corruption typically in close to full disk utilization.master
parent
04e82fd549
commit
a6ec7d343b
|
@ -278,7 +278,7 @@ runlist *ntfs_cluster_alloc(ntfs_volume *vol, VCN start_vcn, s64 count,
|
|||
bmp_pos &= ~7;
|
||||
writeback = 0;
|
||||
|
||||
while (1) {
|
||||
while (lcn < buf_size) {
|
||||
byte = buf + (lcn >> 3);
|
||||
bit = 1 << (lcn & 7);
|
||||
if (has_guess) {
|
||||
|
|
Loading…
Reference in New Issue