hammer - Fix filesystem selection path bug in cleanup directive
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 15 Aug 2013 07:57:53 +0000 (00:57 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 15 Aug 2013 07:57:53 +0000 (00:57 -0700)
commiteb5751f677b7e7206a65a83b5fcf401a3ad378f8
treef1d6248b5db40bae0954cb10f7db0bd1994e5ffe
parent22eba164e7981e21d63a7bd27d78eceeb8dcf3e8
hammer - Fix filesystem selection path bug in cleanup directive

* When being asked to cleanup a hammer filesystem, hammer checks the
  /var/hammer/<filesystem>/ directory for manual snapshots and is able
  to extract the target filesystem from the softlinks it finds.

  If no softlinks are found hammer incorrectly calls 'hammer prune'
  with the /var/hammer/* path instead of the target filesystem path
  which causes the prune code to prune the wrong filesystem.

* Issue only happened when snapshots were disabled but snapshot aging
  was being enforced.  e.g. in the hammer config for the filesystem,
  something like 'snapshots 0d 60d'.  This feature tends to be used
  only on slaves that are the target of a mirror-stream backup.
  Other combinations will either have created snapshot softlinks
  in /var/hammer/* or would have disabled snapshots entirely (which
  causes a prune-everything to happen and doesn't have the bug).
sbin/hammer/cmd_cleanup.c
sbin/hammer/cmd_softprune.c
sbin/hammer/hammer.h