Skip to content

Commit

Permalink
add_inode: doesn't look like you can have compressed resident data
Browse files Browse the repository at this point in the history
  • Loading branch information
maharmstone committed Dec 30, 2020
1 parent 9e78a59 commit 8bcff23
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/ntfs2btrfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1687,21 +1687,24 @@ static void add_inode(root& r, uint64_t inode, uint64_t ntfs_inode, bool& is_dir
return true;
}

if (att->Flags & ATTRIBUTE_FLAG_COMPRESSION_MASK) {
clear_line();

if (filename.empty())
filename = f.get_filename();

fmt::print(stderr, FMT_STRING("Skipping compressed inode {:x} ({})\n"), inode - inode_offset, filename.c_str());
return true;
}

if (att->FormCode == NTFS_ATTRIBUTE_FORM::RESIDENT_FORM) {
file_size = att->Form.Resident.ValueLength;

inline_data = res_data;

// ATTRIBUTE_FLAG_COMPRESSION_MASK can be set in flags, but doesn't seem to do anything
} else {
if (att->Flags & ATTRIBUTE_FLAG_COMPRESSION_MASK) {
clear_line();

if (filename.empty())
filename = f.get_filename();

fmt::print(stderr, FMT_STRING("Skipping compressed inode {:x} ({})\n"), inode - inode_offset, filename.c_str());
return true;
}

file_size = att->Form.Nonresident.FileSize;

// FIXME - if ValidDataLength < FileSize, will need to zero end
Expand Down

0 comments on commit 8bcff23

Please sign in to comment.