Fixed allocated size when an attribute update causes unnamed data to be expelled
parent
9b2ecca3df
commit
6bf4af7544
|
@ -5011,6 +5011,15 @@ static int ntfs_resident_attr_resize_i(ntfs_attr *na, const s64 newsize,
|
||||||
ntfs_attr_close(tna);
|
ntfs_attr_close(tna);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ((tna->type == AT_DATA) && !tna->name_len) {
|
||||||
|
/*
|
||||||
|
* If we had to make the unnamed data attribute
|
||||||
|
* non-resident, propagate its new allocated size
|
||||||
|
* to all name attributes and directory indexes
|
||||||
|
*/
|
||||||
|
tna->ni->allocated_size = tna->allocated_size;
|
||||||
|
NInoFileNameSetDirty(tna->ni);
|
||||||
|
}
|
||||||
if (((tna->data_flags & ATTR_COMPRESSION_MASK)
|
if (((tna->data_flags & ATTR_COMPRESSION_MASK)
|
||||||
== ATTR_IS_COMPRESSED)
|
== ATTR_IS_COMPRESSED)
|
||||||
&& ntfs_attr_pclose(tna)) {
|
&& ntfs_attr_pclose(tna)) {
|
||||||
|
|
|
@ -845,6 +845,12 @@ static int ntfs_inode_sync_file_name(ntfs_inode *ni, ntfs_inode *dir_ni)
|
||||||
else {
|
else {
|
||||||
fnx->allocated_size = cpu_to_sle64(ni->allocated_size);
|
fnx->allocated_size = cpu_to_sle64(ni->allocated_size);
|
||||||
fnx->data_size = cpu_to_sle64(ni->data_size);
|
fnx->data_size = cpu_to_sle64(ni->data_size);
|
||||||
|
/*
|
||||||
|
* The file name record has also to be fixed if some
|
||||||
|
* attribute update implied the unnamed data to be
|
||||||
|
* made non-resident
|
||||||
|
*/
|
||||||
|
fn->allocated_size = fnx->allocated_size;
|
||||||
}
|
}
|
||||||
/* update or clear the reparse tag in the index */
|
/* update or clear the reparse tag in the index */
|
||||||
fnx->reparse_point_tag = reparse_tag;
|
fnx->reparse_point_tag = reparse_tag;
|
||||||
|
|
Loading…
Reference in New Issue