Skip to content

Commit

Permalink
bugfix: do not fail on errors within dd, ignore those extents instead.
Browse files Browse the repository at this point in the history
bugfix: do not truncate recovered files if extents are not ordered.
  • Loading branch information
ianka committed Sep 20, 2019
1 parent 7d9960e commit 53008a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xfs_undelete
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ for {set block [dict get $::parameters s]} {$block<$dblocks} {incr block} {
## Ignore extents beyond the filesystem.
if {($skip+$count)>=$dblocks} continue

## Recover the data from this extent.
exec -ignorestderr -- dd 2>/dev/null if=$fs of=$of bs=$blocksize skip=$skip seek=$loffset count=$count
## 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

## Remember there was at least one recovered extent.
set recovered 1
Expand Down

0 comments on commit 53008a3

Please sign in to comment.