Workaround windows defragmentation tool bug.
Windows defragmentation tool do not update name offset correctly for unnamed attributes, but chkdsk do not like when it negative, so do not change it at all if it would become negative. (Szaka)edge.strict_endians
parent
b392bd17c8
commit
54d7899368
|
@ -4386,7 +4386,16 @@ retry:
|
|||
memmove((u8*)a + le16_to_cpu(a->name_offset) -
|
||||
8, (u8*)a + le16_to_cpu(a->name_offset),
|
||||
a->name_length * sizeof(ntfschar));
|
||||
a->name_offset = cpu_to_le16(le16_to_cpu(
|
||||
/*
|
||||
* Windows defragmentation tool do not update
|
||||
* name offset correctly for unnamed
|
||||
* attributes, but chkdsk do not like when it
|
||||
* negative, so do not change it at all if it
|
||||
* would become negative.
|
||||
*/
|
||||
if (le16_to_cpu(a->name_offset) >= 8)
|
||||
a->name_offset = cpu_to_le16(
|
||||
le16_to_cpu(
|
||||
a->name_offset) - 8);
|
||||
a->mapping_pairs_offset =
|
||||
cpu_to_le16(le16_to_cpu(
|
||||
|
|
Loading…
Reference in New Issue