--- fuse-comp.pl 2007/07/15 23:52:55 32 +++ fuse-comp.pl 2007/07/16 07:41:55 33 @@ -146,7 +146,7 @@ if ( -s $path ) { file_copy( '<:gzip', $path, '>', $tmp ) } else { - confess "ASSERT: filesystem corruption, $path is zero size\n"; + confess "ASSERT: filesystem corruption, $path is zero size in ",dump( $pending ); } $path = $tmp; $op = 'created'; @@ -155,7 +155,7 @@ confess "ASSERT: open shouldn't exist for $file in ", dump( $pending ) if defined( $pending->{$file}->{open} ); $pending->{$file}->{path} = $path; $pending->{$file}->{open} = 0; # not really opened, just uncompressed - warn "## tmp_file( $file ) $op $path [", -s $path, "]\n"; + warn "## tmp_file( $file ) $op $path [", -s $path, "]\n" if $debug; } return $path; } @@ -174,7 +174,7 @@ } elsif ( ! $path ) { $path = $pending_path; } elsif ( $pending_path ne $path ) { - confess "ASSERT: compressing into $path instead of $pending_path\n"; + confess "ASSERT: compressing into $path instead of $pending_path"; } } @@ -203,8 +203,9 @@ my ( $size_path, $size_comp ) = ( -s $path, -s $comp ); if ( $size_path <= $size_comp ) { - warn ">>> $size_path <= $size_comp leaving uncompressed\n"; + warn ">>> $size_path <= $size_comp leaving uncompressed $dest\n"; unlink $comp || confess "can't remove: $comp: $!"; + file_copy( '<', $path, '>', $dest ) if ( $path ne $dest ); } else { warn ">>> compressed $size_path -> $size_comp ",int(($size_comp * 100) / $size_path),"% $comp\n"; @@ -373,7 +374,7 @@ my $tmp = $mount->{tmp} . '/' . $old; if ( -e $tmp ) { if ( $new =~ m#\Q/.fuse_hidden\E# ) { - unlink $tmp || confess "can't unlink $tmp for $new\n"; + unlink $tmp || confess "can't unlink $tmp for $new"; } else { my $new_tmp = $mount->{tmp} . '/' . $new; rename $tmp, $new_tmp || confess "can't rename $tmp -> $new_tmp : $!";