Skip to content

Commit

Permalink
- use .snapshots dir for 'btrfs qgroup clear-stale' (bsc#1229904)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschnell committed Aug 29, 2024
1 parent 746c29f commit ab49e1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 5 additions & 3 deletions client/systemd-helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,18 @@ cleanup(ProxySnappers* snappers)
string subvolume;
if (proxy_config.getValue(KEY_SUBVOLUME, subvolume))
{
cout << "Running 'btrfs qgroup clear-stale " << subvolume << "'." << endl;
string general_dir = (subvolume == "/" ? "" : subvolume) + "/" SNAPSHOTS_NAME;

SystemCmd cmd({ BTRFS_BIN, "qgroup", "clear-stale", subvolume });
cout << "Running 'btrfs qgroup clear-stale " << general_dir << "'." << endl;

SystemCmd cmd({ BTRFS_BIN, "qgroup", "clear-stale", general_dir });
if (cmd.retcode() != 0)
{
// This fails more often than not since qgroups of just deleted
// subvolume are busy. So do not set an error code here. Still log the
// failure to help people understand this stuff.

cerr << "'btrfs qgroup clear-stale " << subvolume << "' failed." << endl;
cerr << "'btrfs qgroup clear-stale " << general_dir << "' failed." << endl;
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions package/snapper.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Aug 29 17:42:35 CEST 2024 - aschnell@suse.com

- use .snapshots dir for 'btrfs qgroup clear-stale' (bsc#1229904)

-------------------------------------------------------------------
Fri Jul 05 16:03:42 CEST 2024 - aschnell@suse.com

Expand Down

0 comments on commit ab49e1f

Please sign in to comment.