Skip to content

Commit

Permalink
print block address in an error message
Browse files Browse the repository at this point in the history
  • Loading branch information
FUJITA Yuki committed Jun 17, 2024
1 parent 6874c80 commit 22dd741
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ext4/inode.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func resolveSingleIndirectBlockAddress(ext4 *FileSystem, singleIndirectBlockAddr

singleIndirectBlockAddresses, err := readBlock(ext4.r, ext4.sb.GetBlockSize())
if err != nil {
return nil, xerrors.Errorf("failed to read directory entry: %w", err)
return nil, xerrors.Errorf("failed to read directory entry at block address %#x: %w", singleIndirectBlockAddress, err)
}

for singleIndirectBlockAddresses.Len() > 0 {
Expand All @@ -145,7 +145,7 @@ func resolveDoubleIndirectBlockAddress(ext4 *FileSystem, doubleIndirectBlockAddr

doubleIndirectBlockAddresses, err := readBlock(ext4.r, ext4.sb.GetBlockSize())
if err != nil {
return nil, xerrors.Errorf("failed to read directory entry: %w", err)
return nil, xerrors.Errorf("failed to read directory entry at block address %#x: %w", doubleIndirectBlockAddress, err)
}

for doubleIndirectBlockAddresses.Len() > 0 {
Expand Down Expand Up @@ -174,7 +174,7 @@ func resolveTripleIndirectBlockAddress(ext4 *FileSystem, tripleIndirectBlockAddr

tripleIndirectBlockAddresses, err := readBlock(ext4.r, ext4.sb.GetBlockSize())
if err != nil {
return nil, xerrors.Errorf("failed to read directory entry: %w", err)
return nil, xerrors.Errorf("failed to read directory entry at block address %#x: %w", tripleIndirectBlockAddress, err)
}

for tripleIndirectBlockAddresses.Len() > 0 {
Expand Down

0 comments on commit 22dd741

Please sign in to comment.