chattr-ignore-nocow.patch 421 B

1234567891011121314151617181920
  1. diff a/tmpfiles.sh b/tmpfiles.sh
  2. --- a/tmpfiles.sh
  3. +++ b/tmpfiles.sh
  4. @@ -54,6 +54,15 @@ _chattr() {
  5. '') return ;;
  6. *) attr="+$attr" ;;
  7. esac
  8. +
  9. + # ignore attempts to set unsupported attributes
  10. + local fs_type
  11. + case $attr in
  12. + [+-=]C) fs_type="$(df --output=fstype "$3" | tail --lines=1)"
  13. + test "$fstype" == 'btrfs' || return 0
  14. + ;;
  15. + esac
  16. +
  17. local IFS=
  18. dryrun_or_real chattr "$1" "$attr" -- "$3"
  19. }