Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rafs: fix a bug in calculate offset for dirent name #1106

Merged
merged 1 commit into from
Feb 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion rafs/src/metadata/direct_v6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,11 @@ impl OndiskInodeWrapper {
// Because the other blocks should be fully used, while the last may not.
let len = if div_round_up(self.size(), EROFS_BLOCK_SIZE) as usize == block_index + 1
{
(self.size() % EROFS_BLOCK_SIZE - s) as usize
if self.size() % EROFS_BLOCK_SIZE == 0 {
EROFS_BLOCK_SIZE as usize
} else {
(self.size() % EROFS_BLOCK_SIZE - s) as usize
}
} else {
(EROFS_BLOCK_SIZE - s) as usize
};
Expand Down