Fixed usa checking by ntfsck on 4K sectors

The usa sequence is used to make sure the sectors containing metadata
are fully written. The values are always put at the end of 512-byte
chunks even if the sectors are greater.
edge.strict_endians
Jean-Pierre André 2013-04-22 19:14:48 +02:00
parent c5a11341b0
commit be58b3b1f6
1 changed files with 2 additions and 2 deletions

View File

@ -616,9 +616,9 @@ static BOOL check_file_record(u8 *buffer, u16 buflen)
// Remove update seq & check it.
usa = *(u16*)(buffer+usa_ofs); // The value that should be at the end of every sector.
assert_u32_equal(usa_count-1, buflen/bytes_per_sector, "USA length");
assert_u32_equal(usa_count-1, buflen/NTFS_BLOCK_SIZE, "USA length");
for (i=1;i<usa_count;i++) {
u16 *fixup = (u16*)(buffer+bytes_per_sector*i-2); // the value at the end of the sector.
u16 *fixup = (u16*)(buffer+NTFS_BLOCK_SIZE*i-2); // the value at the end of the sector.
u16 saved_val = *(u16*)(buffer+usa_ofs+2*i); // the actual data value that was saved in the us array.
assert_u32_equal(*fixup, usa, "fixup");