fix: Check attribute (#258)

This commit is contained in:
Kroese 2023-12-24 14:29:47 +01:00 committed by GitHub
parent dda8a37372
commit 0c5f7bae96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,10 +118,6 @@ createDisk() {
error "$FAIL" && exit 77
fi
{ chattr +C "$DISK_FILE"; } || :
FA=$(lsattr "$DISK_FILE")
if [[ "$FA" != *"C"* ]]; then
error "Failed to disable COW for $DISK_DESC image $DISK_FILE on ${FS^^} filesystem (returned $FA)"
fi
fi
if [[ "$ALLOCATE" == [Nn]* ]]; then
@ -154,6 +150,8 @@ createDisk() {
rm -f "$DISK_FILE"
error "$FAIL" && exit 70
fi
;;
esac
if isCow "$FS"; then
FA=$(lsattr "$DISK_FILE")
@ -162,9 +160,6 @@ createDisk() {
fi
fi
;;
esac
return 0
}
@ -323,7 +318,7 @@ checkFS () {
if [ -f "$DISK_FILE" ]; then
FA=$(lsattr "$DISK_FILE")
if [[ "$FA" != *"C"* ]]; then
info "Warning: COW (copy on write) is not disabled for the $DISK_DESC image file $DISK_FILE, this is recommended on ${FS^^} filesystems!"
info "Warning: COW (copy on write) is not disabled for $DISK_DESC image file $DISK_FILE, this is recommended on ${FS^^} filesystems!"
fi
fi
fi