Skip to content

Commit

Permalink
Silently ignore extents even a 64-bit dd cannot handle. These are mos…
Browse files Browse the repository at this point in the history
…t likely bogus.
  • Loading branch information
ianka committed Feb 4, 2020
1 parent ff4248f commit 86db781
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xfs_undelete
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,12 @@ for {set block [dict get $::parameters s]} {$block<$dblocks} {incr block} {
## Ignore preallocated, unwritten extents.
if {$flag} continue

## Ignore extents beyond the filesystem.
## Silently ignore extents beyond the filesystem. These are clearly bogus.
if {($skip+$count)>=$dblocks} continue

## Silently ignore extents even a 64-bit dd cannot handle. These are most likely bogus.
if {($blocksize*$loffset)>=(2**63-1)} continue

## Recover the data from this extent. Ignore extents for which dd reported a problem.
if {[catch {exec -ignorestderr -- dd if=$fs of=$of bs=$blocksize skip=$skip seek=$loffset count=$count conv=notrunc status=none}]} continue

Expand Down

0 comments on commit 86db781

Please sign in to comment.