Skip to content

Commit

Permalink
inodeLast checked and updated during fsck; needs latest BackupPC::XS
Browse files Browse the repository at this point in the history
version 0.57
  • Loading branch information
craigbarratt committed Dec 2, 2017
1 parent ef4a7d4 commit 9debb7b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bin/BackupPC
Expand Up @@ -44,7 +44,7 @@
#
#========================================================================
#
# Version 4.0.2, released 18 Mar 2017.
# Version 4.1.4, released 24 Nov 2017.
#
# See http://backuppc.sourceforge.net.
#
Expand Down Expand Up @@ -104,7 +104,7 @@ if ( $Conf{BackupPCUserVerify}
# Ensure we don't have old versions of key libraries and executables
###########################################################################
my $PackageVersion = {
'BackupPC::XS' => '0.56',
'BackupPC::XS' => '0.57',
rsync_bpc => '3.0.9.8',
};

Expand Down
18 changes: 16 additions & 2 deletions bin/BackupPC_refCountUpdate
Expand Up @@ -30,7 +30,7 @@
#
#========================================================================
#
# Version 4.1.2, released 30 Apr 2017.
# Version 4.1.4, released 25 Nov 2017.
#
# See http://backuppc.sourceforge.net.
#
Expand Down Expand Up @@ -364,9 +364,23 @@ sub processOneHostBackup
}
my $deltaInfo = BackupPC::XS::DeltaRefCnt::new("$pcDir/$bkupNum");
print("__bpc_progress_state__ refCnt #$bkupNum\n") if ( !$opts{p} );
$ErrorCnt += BackupPC::XS::DirOps::refCountAll("$pcDir/$bkupNum", $compress, 1, $deltaInfo);
my($err, $inodeMax) = BackupPC::XS::DirOps::refCountAllInodeMax("$pcDir/$bkupNum", $compress, 1, $deltaInfo);
$ErrorCnt += $err;
$deltaInfo->flush();
$bpc->flushXSLibMesgs();
#
# Update inodeLast for this backup if it is larger than what's stored in backups
#
my @backups = $bpc->BackupInfoRead($host);
for ( my $i = 0 ; $i < @backups ; $i++ ) {
next if ( $backups[$i]{num} != $bkupNum || $backups[$i]{inodeLast} > $inodeMax );
$inodeMax += 2;
print("BackupPC_refCountUpdate: $host #$bkupNum inodeLast set to $inodeMax (was $backups[$i]{inodeLast})\n");
$backups[$i]{inodeLast} = $inodeMax;
BackupPC::Storage->backupInfoWrite($pcDir, $bkupNum, $backups[$i], 1);
$bpc->BackupInfoWrite($host, @backups);
last;
}
}
print("__bpc_progress_state__ cntUpdate #$bkupNum\n") if ( !$opts{p} );
updateHostDelta2Cnt($host, $bkupRefCntDir, $fsck, 0, $bkupNum);
Expand Down

0 comments on commit 9debb7b

Please sign in to comment.