OSDN Git Service

Fixed huge data writes
authorJean-Pierre André <jpandre@users.sourceforge.net>
Thu, 20 Oct 2011 17:05:27 +0000 (19:05 +0200)
committerJean-Pierre André <jpandre@users.sourceforge.net>
Thu, 20 Oct 2011 17:05:27 +0000 (19:05 +0200)
When computing the runlist for the first non-resident write to an
attribute, an inconsistency was created between the attribute image
and the ntfs_attr structure, which could cause an MFT record overflow
when the first write is huge and fragmented (reported by Vito Caputo).

libntfs-3g/attrib.c

index 14a2efc..281a620 100644 (file)
@@ -5468,6 +5468,7 @@ static int ntfs_attr_update_meta(ATTR_RECORD *a, ntfs_attr *na, MFT_RECORD *m,
                
                NAttrClearSparse(na);
                a->flags &= ~ATTR_IS_SPARSE;
+               na->data_flags = a->flags;
                a->compression_unit = 0;
                
                memmove((u8*)a + le16_to_cpu(a->name_offset) - 8,