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
szaka 2008-05-05 15:36:58 +00:00
parent 04e82fd549
commit a6ec7d343b
1 changed files with 1 additions and 1 deletions

View File

@ -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) {