Skip to content

Commit

Permalink
IS 968
Browse files Browse the repository at this point in the history
  • Loading branch information
olehnikolaiev committed Oct 16, 2024
1 parent badef22 commit af1a452
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion libskale/SnapshotManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,23 @@ void SnapshotManager::leaveNLastSnapshots( unsigned n ) {
for ( const auto& p : numbers ) {
if ( i++ > n ) {
const fs::path& path = p.second;
for ( const string& v : allVolumes ) {
for ( const string& v : coreVolumes ) {
if ( btrfs.subvolume._delete( ( path / v ).c_str() ) ) {
throw CannotPerformBtrfsOperation( btrfs.last_cmd(), btrfs.strerror() );
}
}

#ifdef HISTORIC_STATE
for ( const string& v : archiveVolumes ) {
// ignore as it might indicate that archive volumes weren't snapshotted
if ( !fs::exists( path / v ) )
continue;
if ( btrfs.subvolume._delete( ( path / v ).c_str() ) ) {
throw CannotPerformBtrfsOperation( btrfs.last_cmd(), btrfs.strerror() );
}
}
#endif

fs::remove_all( path );
} // if
} // for
Expand Down

0 comments on commit af1a452

Please sign in to comment.