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